diff --git a/libresonic-main/src/main/java/org/libresonic/player/domain/RandomSearchCriteria.java b/libresonic-main/src/main/java/org/libresonic/player/domain/RandomSearchCriteria.java index a192350e..3e746316 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/domain/RandomSearchCriteria.java +++ b/libresonic-main/src/main/java/org/libresonic/player/domain/RandomSearchCriteria.java @@ -19,6 +19,7 @@ */ package org.libresonic.player.domain; +import java.util.Date; import java.util.List; /** @@ -34,6 +35,13 @@ public class RandomSearchCriteria { private final Integer fromYear; private final Integer toYear; private final List musicFolders; + private final Date minLastPlayedDate; + private final Date maxLastPlayedDate; + private final Integer minAlbumRating; + private final Integer maxAlbumRating; + private final boolean showStarredSongs; + private final boolean showUnstarredSongs; + private final String format; /** * Creates a new instance. @@ -45,11 +53,55 @@ public class RandomSearchCriteria { * @param musicFolders Only return songs from these music folder. May NOT be null. */ public RandomSearchCriteria(int count, String genre, Integer fromYear, Integer toYear, List musicFolders) { + this( + count, genre, fromYear, toYear, musicFolders, + null, null, null, null, true, true, null + ); + } + + /** + * Creates a new instance. + * + * @param count Maximum number of songs to return. + * @param genre Only return songs of the given genre. May be null. + * @param fromYear Only return songs released after (or in) this year. May be null. + * @param toYear Only return songs released before (or in) this year. May be null. + * @param musicFolders Only return songs from these music folder. May NOT be null. + * @param minLastPlayedDate Only return songs last played after this date. May be null. + * @param maxLastPlayedDate Only return songs last played before this date. May be null. + * @param minAlbumRating Only return songs rated more or equalt to this value. May be null. + * @param maxAlbumRating Only return songs rated less or equal to this value. May be null. + * @param showStarredSongs Show starred songs. May NOT be null. + * @param showUnstarredSongs Show unstarred songs. May NOT be null. + * @param format Only return songs whose file format is equal to this value. May be null. + */ + public RandomSearchCriteria( + int count, + String genre, + Integer fromYear, + Integer toYear, + List musicFolders, + Date minLastPlayedDate, + Date maxLastPlayedDate, + Integer minAlbumRating, + Integer maxAlbumRating, + boolean showStarredSongs, + boolean showUnstarredSongs, + String format + ) { + this.count = count; this.genre = genre; this.fromYear = fromYear; this.toYear = toYear; this.musicFolders = musicFolders; + this.minLastPlayedDate = minLastPlayedDate; + this.maxLastPlayedDate = maxLastPlayedDate; + this.minAlbumRating = minAlbumRating; + this.maxAlbumRating = maxAlbumRating; + this.showStarredSongs = showStarredSongs; + this.showUnstarredSongs = showUnstarredSongs; + this.format = format; } public int getCount() { @@ -71,4 +123,32 @@ public class RandomSearchCriteria { public List getMusicFolders() { return musicFolders; } + + public Date getMinLastPlayedDate() { + return minLastPlayedDate; + } + + public Date getMaxLastPlayedDate() { + return maxLastPlayedDate; + } + + public Integer getMinAlbumRating() { + return minAlbumRating; + } + + public Integer getMaxAlbumRating() { + return maxAlbumRating; + } + + public boolean isShowStarredSongs() { + return showStarredSongs; + } + + public boolean isShowUnstarredSongs() { + return showUnstarredSongs; + } + + public String getFormat() { + return format; + } } diff --git a/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties b/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties index a71e11bb..66ad6030 100644 --- a/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties +++ b/libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties @@ -233,12 +233,30 @@ more.random.text = Shuffle play more.random.songs = {0} songs more.random.auto = Play more random songs when end of play queue is reached. more.random.ok = OK -more.random.genre = from genre +more.random.add = Add +more.random.any = Any +more.random.format = Format +more.random.before = Before +more.random.after = After +more.random.genre = Genre more.random.anygenre = Any -more.random.year = and year +more.random.year = Year more.random.anyyear = Any -more.random.folder = in folder +more.random.folder = Folder more.random.anyfolder = Any +more.random.star = star +more.random.stars = stars +more.random.starred = Starred +more.random.unstarred = Unstarred +more.random.songrating = Song rating +more.random.albumrating = Album rating +more.random.lastplayed = Last played +more.random.1day = 1 day ago +more.random.1week = 1 week ago +more.random.1month = 1 month ago +more.random.3months = 3 months ago +more.random.6months = 6 months ago +more.random.1year = 1 year ago more.apps.title = Libresonic Apps more.apps.text =

Check out the steadily growing list of Libresonic apps. \ These provide fun and alternative ways to enjoy your media collection - no matter where you are. \ diff --git a/libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp b/libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp index 1f0e016c..0648f112 100644 --- a/libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp +++ b/libresonic-main/src/main/webapp/WEB-INF/jsp/more.jsp @@ -63,8 +63,11 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - "> + "> + "> @@ -187,4 +256,4 @@ - \ No newline at end of file +