summaryrefslogtreecommitdiffstats
path: root/clerk_rating_client
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-10-04 00:46:15 +0200
committerRasmus Steinke <rasi@xssn.at>2017-10-04 00:46:15 +0200
commita4b8b2fcce33323076bac1d9a9667f5254d59f88 (patch)
treecc788c7868c4f1d777ab121a5e7d475ac1217352 /clerk_rating_client
parentee8374e5c41f74072baf1ca9320db7aadb612f0e (diff)
downloadperl-app-clerk-a4b8b2fcce33323076bac1d9a9667f5254d59f88.tar.gz
perl-app-clerk-a4b8b2fcce33323076bac1d9a9667f5254d59f88.tar.xz
fix regex for file extensions
Diffstat (limited to 'clerk_rating_client')
-rwxr-xr-xclerk_rating_client12
1 files changed, 6 insertions, 6 deletions
diff --git a/clerk_rating_client b/clerk_rating_client
index 269dad0..87fcd14 100755
--- a/clerk_rating_client
+++ b/clerk_rating_client
@@ -60,7 +60,7 @@ sub track_rating {
my $artist = $song_tags[0]->{Artist};
my $title = $song_tags[0]->{Title};
my $album = $song_tags[0]->{Album};
- if ($uri =~ /.*.flac$/) {
+ if ($uri =~ /\.flac$/) {
if ($mode eq "rating") {
print ":: tagging track \"${title}\" by \"${artist}\" with rating of \"${rating}\"\n";
system('metaflac', '--remove-tag=RATING', "${music_root}/${uri}");
@@ -71,7 +71,7 @@ sub track_rating {
system('metaflac', "--set-tag=ALBUMRATING=${rating}", "${music_root}/${uri}");
}
}
- elsif ($uri =~ /.*.mp3$/) {
+ elsif ($uri =~ /\.mp3$/) {
if ($mode eq "rating") {
print ":: tagging track \"${title}\" by \"${artist}\" with rating of \"${rating}\"\n";
system('mid3v2', "--TXXX", "RATING:${rating}", "${music_root}/${uri}");
@@ -80,7 +80,7 @@ sub track_rating {
system('mid3v2', "--TXXX", "ALBUMRATING:${rating}", "${music_root}/${uri}");
}
}
- elsif ($uri =~ /.*.ogg$/) {
+ elsif ($uri =~ /\.ogg$/) {
print "!! OGG files not supported, yet\n";
}
}
@@ -121,14 +121,14 @@ sub tag_from_sticker {
foreach my $rated_song (@available_stickers) {
my $uri = $rated_song->{file};
my $rating = $rated_song->{sticker};
- if ($uri =~ /.*.flac$/) {
+ if ($uri =~ /\.flac$/) {
system('metaflac', '--remove-tag=RATING', "${music_root}/${uri}");
system('metaflac', "--set-tag=RATING=$rating", "${music_root}/${uri}");
}
- elsif ($uri =~ /.*.mp3$/) {
+ elsif ($uri =~ /\.mp3$/) {
system('mid3v2', "--TXXX", "RATING:${rating}", "${music_root}/${uri}");
}
- elsif ($uri =~ /.*.ogg$/) {
+ elsif ($uri =~ /\.ogg$/) {
print "!! OGG files not supported, yet\n";
}
}