|
|
@ -19,6 +19,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.libresonic.player.domain; |
|
|
|
package org.libresonic.player.domain; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -34,6 +35,13 @@ public class RandomSearchCriteria { |
|
|
|
private final Integer fromYear; |
|
|
|
private final Integer fromYear; |
|
|
|
private final Integer toYear; |
|
|
|
private final Integer toYear; |
|
|
|
private final List<MusicFolder> musicFolders; |
|
|
|
private final List<MusicFolder> 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. |
|
|
|
* Creates a new instance. |
|
|
@ -45,11 +53,55 @@ public class RandomSearchCriteria { |
|
|
|
* @param musicFolders Only return songs from these music folder. May NOT be <code>null</code>. |
|
|
|
* @param musicFolders Only return songs from these music folder. May NOT be <code>null</code>. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RandomSearchCriteria(int count, String genre, Integer fromYear, Integer toYear, List<MusicFolder> musicFolders) { |
|
|
|
public RandomSearchCriteria(int count, String genre, Integer fromYear, Integer toYear, List<MusicFolder> 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 <code>null</code>. |
|
|
|
|
|
|
|
* @param fromYear Only return songs released after (or in) this year. May be <code>null</code>. |
|
|
|
|
|
|
|
* @param toYear Only return songs released before (or in) this year. May be <code>null</code>. |
|
|
|
|
|
|
|
* @param musicFolders Only return songs from these music folder. May NOT be <code>null</code>. |
|
|
|
|
|
|
|
* @param minLastPlayedDate Only return songs last played after this date. May be <code>null</code>. |
|
|
|
|
|
|
|
* @param maxLastPlayedDate Only return songs last played before this date. May be <code>null</code>. |
|
|
|
|
|
|
|
* @param minAlbumRating Only return songs rated more or equalt to this value. May be <code>null</code>. |
|
|
|
|
|
|
|
* @param maxAlbumRating Only return songs rated less or equal to this value. May be <code>null</code>. |
|
|
|
|
|
|
|
* @param showStarredSongs Show starred songs. May NOT be <code>null</code>. |
|
|
|
|
|
|
|
* @param showUnstarredSongs Show unstarred songs. May NOT be <code>null</code>. |
|
|
|
|
|
|
|
* @param format Only return songs whose file format is equal to this value. May be <code>null</code>. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public RandomSearchCriteria( |
|
|
|
|
|
|
|
int count, |
|
|
|
|
|
|
|
String genre, |
|
|
|
|
|
|
|
Integer fromYear, |
|
|
|
|
|
|
|
Integer toYear, |
|
|
|
|
|
|
|
List<MusicFolder> musicFolders, |
|
|
|
|
|
|
|
Date minLastPlayedDate, |
|
|
|
|
|
|
|
Date maxLastPlayedDate, |
|
|
|
|
|
|
|
Integer minAlbumRating, |
|
|
|
|
|
|
|
Integer maxAlbumRating, |
|
|
|
|
|
|
|
boolean showStarredSongs, |
|
|
|
|
|
|
|
boolean showUnstarredSongs, |
|
|
|
|
|
|
|
String format |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
|
|
|
|
this.count = count; |
|
|
|
this.count = count; |
|
|
|
this.genre = genre; |
|
|
|
this.genre = genre; |
|
|
|
this.fromYear = fromYear; |
|
|
|
this.fromYear = fromYear; |
|
|
|
this.toYear = toYear; |
|
|
|
this.toYear = toYear; |
|
|
|
this.musicFolders = musicFolders; |
|
|
|
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() { |
|
|
|
public int getCount() { |
|
|
@ -71,4 +123,32 @@ public class RandomSearchCriteria { |
|
|
|
public List<MusicFolder> getMusicFolders() { |
|
|
|
public List<MusicFolder> getMusicFolders() { |
|
|
|
return musicFolders; |
|
|
|
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; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|