2014-12-15 06:16:23 +01:00
|
|
|
|
using MediaBrowser.Model.Dto;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Model.Sync
|
|
|
|
|
{
|
|
|
|
|
public static class SyncHelper
|
|
|
|
|
{
|
|
|
|
|
public static List<SyncOptions> GetSyncOptions(List<BaseItemDto> items)
|
|
|
|
|
{
|
|
|
|
|
List<SyncOptions> options = new List<SyncOptions>();
|
|
|
|
|
|
|
|
|
|
if (items.Count > 1)
|
|
|
|
|
{
|
|
|
|
|
options.Add(SyncOptions.Name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (BaseItemDto item in items)
|
|
|
|
|
{
|
|
|
|
|
if (item.SupportsSync ?? false)
|
|
|
|
|
{
|
|
|
|
|
if (item.IsVideo)
|
|
|
|
|
{
|
|
|
|
|
options.Add(SyncOptions.Quality);
|
2014-12-17 06:30:31 +01:00
|
|
|
|
if (items.Count > 1)
|
|
|
|
|
{
|
|
|
|
|
options.Add(SyncOptions.UnwatchedOnly);
|
|
|
|
|
}
|
2014-12-15 06:16:23 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (item.IsFolder && !item.IsMusicGenre && !item.IsArtist && !item.IsType("musicalbum") && !item.IsGameGenre)
|
|
|
|
|
{
|
|
|
|
|
options.Add(SyncOptions.Quality);
|
|
|
|
|
options.Add(SyncOptions.UnwatchedOnly);
|
|
|
|
|
break;
|
2014-12-17 06:30:31 +01:00
|
|
|
|
}
|
|
|
|
|
if (item.IsGenre)
|
|
|
|
|
{
|
|
|
|
|
options.Add(SyncOptions.SyncNewContent);
|
|
|
|
|
options.Add(SyncOptions.ItemLimit);
|
|
|
|
|
break;
|
2014-12-15 06:16:23 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (BaseItemDto item in items)
|
|
|
|
|
{
|
|
|
|
|
if (item.SupportsSync ?? false)
|
|
|
|
|
{
|
|
|
|
|
if (item.IsFolder || item.IsGameGenre || item.IsMusicGenre || item.IsGenre || item.IsArtist || item.IsStudio || item.IsPerson)
|
|
|
|
|
{
|
|
|
|
|
options.Add(SyncOptions.SyncNewContent);
|
2014-12-16 06:01:57 +01:00
|
|
|
|
options.Add(SyncOptions.ItemLimit);
|
2014-12-15 06:16:23 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return options;
|
|
|
|
|
}
|
2014-12-16 06:01:57 +01:00
|
|
|
|
|
|
|
|
|
public static List<SyncOptions> GetSyncOptions(SyncCategory category)
|
|
|
|
|
{
|
|
|
|
|
List<SyncOptions> options = new List<SyncOptions>();
|
|
|
|
|
|
|
|
|
|
options.Add(SyncOptions.Quality);
|
|
|
|
|
options.Add(SyncOptions.UnwatchedOnly);
|
|
|
|
|
options.Add(SyncOptions.SyncNewContent);
|
|
|
|
|
options.Add(SyncOptions.ItemLimit);
|
|
|
|
|
|
|
|
|
|
return options;
|
|
|
|
|
}
|
2014-12-15 06:16:23 +01:00
|
|
|
|
}
|
|
|
|
|
}
|