add one year tolerance to movie lookups

This commit is contained in:
Luke Pulverenti
2014-07-04 15:17:22 -04:00
parent 385e52c9eb
commit e2b3320f80
7 changed files with 46 additions and 9 deletions

View File

@@ -18,7 +18,12 @@ namespace MediaBrowser.Server.Implementations.Library
public IEnumerable<Audio> GetInstantMixFromSong(Audio item, User user)
{
return GetInstantMixFromGenres(item.Genres, user);
var list = new List<Audio>
{
item
};
return list.Concat(GetInstantMixFromGenres(item.Genres, user));
}
public IEnumerable<Audio> GetInstantMixFromArtist(string name, User user)
@@ -39,7 +44,7 @@ namespace MediaBrowser.Server.Implementations.Library
public IEnumerable<Audio> GetInstantMixFromAlbum(MusicAlbum item, User user)
{
var genres = item
.RecursiveChildren
.GetRecursiveChildren(user, true)
.OfType<Audio>()
.SelectMany(i => i.Genres)
.Concat(item.Genres)
@@ -57,6 +62,7 @@ namespace MediaBrowser.Server.Implementations.Library
return inputItems
.OfType<Audio>()
.Select(i => new Tuple<Audio, int>(i, i.Genres.Count(genresDictionary.ContainsKey)))
.Where(i => i.Item2 > 0)
.OrderByDescending(i => i.Item2)
.ThenBy(i => Guid.NewGuid())
.Select(i => i.Item1)

View File

@@ -858,5 +858,7 @@
"TabBranding": "Branding",
"HeaderBrandingHelp": "Customize the appearance of Media Browser to fit the needs of your group or organization.",
"LabelLoginDisclaimer": "Login disclaimer:",
"LabelLoginDisclaimerHelp": "This will be displayed at the bottom of the login page."
"LabelLoginDisclaimerHelp": "This will be displayed at the bottom of the login page.",
"LabelAutomaticallyDonate": "Automatically donate this amount each month",
"LabelAutomaticallyDonateHelp": "You can cancel at any time via your PayPal account."
}