aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/playlist.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 8f4b17804..9d9c2d60f 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -1679,3 +1679,36 @@ int loadPlaylist(int fd, char *utf8file)
{
return PlaylistIterFunc(fd, utf8file, PlaylistLoadIterFunc);
}
+
+void searchForSongsInPlaylist(int fd, int numItems, LocateTagItem * items)
+{
+ int i;
+ char **originalNeedles = xmalloc(numItems * sizeof(char *));
+
+ for (i = 0; i < numItems; i++) {
+ originalNeedles[i] = items[i].needle;
+ items[i].needle = strDupToUpper(originalNeedles[i]);
+ }
+
+ for (i = 0; i < playlist.length; i++) {
+ if (strstrSearchTags(playlist.songs[i], numItems, items))
+ printPlaylistSongInfo(fd, i);
+ }
+
+ for (i = 0; i < numItems; i++) {
+ free(items[i].needle);
+ items[i].needle = originalNeedles[i];
+ }
+
+ free(originalNeedles);
+}
+
+void findSongsInPlaylist(int fd, int numItems, LocateTagItem * items)
+{
+ int i;
+
+ for (i = 0; i < playlist.length; i++) {
+ if (tagItemsFoundAndMatches(playlist.songs[i], numItems, items))
+ printPlaylistSongInfo(fd, i);
+ }
+}