sync updates

pull/702/head
Luke Pulverenti 10 years ago
parent 94d529beeb
commit e6e5d1a794

@ -191,8 +191,13 @@ namespace MediaBrowser.Controller.Entities.TV
{
var config = user.Configuration;
return GetEpisodes(user, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
}
public IEnumerable<Episode> GetEpisodes(User user, bool includeMissing, bool includeVirtualUnaired)
{
var allEpisodes = GetSeasons(user, true, true)
.SelectMany(i => i.GetEpisodes(user, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes))
.SelectMany(i => i.GetEpisodes(user, includeMissing, includeVirtualUnaired))
.Reverse()
.ToList();

@ -263,9 +263,9 @@ namespace MediaBrowser.Providers.MediaInfo
audio.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Artist Id")));
audio.SetProviderId(MetadataProviders.MusicBrainzArtist, GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Artist Id")));
audio.SetProviderId(MetadataProviders.MusicBrainzAlbum, FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Id"));
audio.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Group Id"));
audio.SetProviderId(MetadataProviders.MusicBrainzTrack, FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Track Id"));
audio.SetProviderId(MetadataProviders.MusicBrainzAlbum, GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Id")));
audio.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Group Id")));
audio.SetProviderId(MetadataProviders.MusicBrainzTrack, GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Track Id")));
}
private string GetMultipleMusicBrainzId(string value)
@ -275,7 +275,10 @@ namespace MediaBrowser.Providers.MediaInfo
return null;
}
return value.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault();
return value.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries)
.Select(i => i.Trim())
.Where(i => !string.IsNullOrWhiteSpace(i))
.FirstOrDefault();
}
private readonly char[] _nameDelimiters = { '/', '|', ';', '\\' };

@ -3,6 +3,7 @@ using MediaBrowser.Common.IO;
using MediaBrowser.Common.Progress;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Sync;
@ -303,11 +304,6 @@ namespace MediaBrowser.Server.Implementations.Sync
return new List<BaseItem>();
}
return GetItemsForSync(item, user);
}
private IEnumerable<BaseItem> GetItemsForSync(BaseItem item, User user)
{
var itemByName = item as IItemByName;
if (itemByName != null)
{
@ -317,6 +313,12 @@ namespace MediaBrowser.Server.Implementations.Sync
.GetRecursiveChildren(user, i => !i.IsFolder && itemByNameFilter(i));
}
var series = item as Series;
if (series != null)
{
return series.GetEpisodes(user, false, false);
}
if (item.IsFolder)
{
var folder = (Folder)item;

Loading…
Cancel
Save