removed folder sync

This commit is contained in:
Luke Pulverenti 2015-03-06 22:53:31 -05:00
parent 23a062103a
commit 998026cfa8
15 changed files with 40 additions and 194 deletions

View File

@ -171,6 +171,9 @@ namespace MediaBrowser.Api.LiveTv
[ApiMember(Name = "MinStartDate", Description = "Optional. The minimum premiere date. Format = ISO", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET,POST")] [ApiMember(Name = "MinStartDate", Description = "Optional. The minimum premiere date. Format = ISO", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET,POST")]
public string MinStartDate { get; set; } public string MinStartDate { get; set; }
[ApiMember(Name = "HasAired", Description = "Optional. Filter by programs that have completed airing, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool? HasAired { get; set; }
[ApiMember(Name = "MaxStartDate", Description = "Optional. The maximum premiere date. Format = ISO", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET,POST")] [ApiMember(Name = "MaxStartDate", Description = "Optional. The maximum premiere date. Format = ISO", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET,POST")]
public string MaxStartDate { get; set; } public string MaxStartDate { get; set; }
@ -369,7 +372,8 @@ namespace MediaBrowser.Api.LiveTv
var query = new ProgramQuery var query = new ProgramQuery
{ {
ChannelIdList = (request.ChannelIds ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToArray(), ChannelIdList = (request.ChannelIds ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToArray(),
UserId = request.UserId UserId = request.UserId,
HasAired = request.HasAired
}; };
if (!string.IsNullOrEmpty(request.MinStartDate)) if (!string.IsNullOrEmpty(request.MinStartDate))

View File

@ -27,6 +27,8 @@ namespace MediaBrowser.Model.LiveTv
public DateTime? MaxEndDate { get; set; } public DateTime? MaxEndDate { get; set; }
public bool? HasAired { get; set; }
public ProgramQuery() public ProgramQuery()
{ {
ChannelIdList = new string[] { }; ChannelIdList = new string[] { };

View File

@ -1,4 +1,5 @@
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
using System.Collections.Generic; using System.Collections.Generic;
namespace MediaBrowser.Model.MediaInfo namespace MediaBrowser.Model.MediaInfo
@ -17,6 +18,12 @@ namespace MediaBrowser.Model.MediaInfo
/// <value>The live stream identifier.</value> /// <value>The live stream identifier.</value>
public string LiveStreamId { get; set; } public string LiveStreamId { get; set; }
/// <summary>
/// Gets or sets the error code.
/// </summary>
/// <value>The error code.</value>
public PlaybackErrorCode? ErrorCode { get; set; }
public LiveMediaInfoResult() public LiveMediaInfoResult()
{ {
MediaSources = new List<MediaSourceInfo>(); MediaSources = new List<MediaSourceInfo>();

View File

@ -659,6 +659,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
programs = programs.Where(i => i.StartDate <= val); programs = programs.Where(i => i.StartDate <= val);
} }
if (query.HasAired.HasValue)
{
var val = query.HasAired.Value;
programs = programs.Where(i => i.HasAired == val);
}
if (query.ChannelIdList.Length > 0) if (query.ChannelIdList.Length > 0)
{ {
var guids = query.ChannelIdList.Select(i => new Guid(i)).ToList(); var guids = query.ChannelIdList.Select(i => new Guid(i)).ToList();

View File

@ -36,8 +36,8 @@
"MessageKeyUpdated": "Thank you. Your supporter key has been updated.", "MessageKeyUpdated": "Thank you. Your supporter key has been updated.",
"MessageKeyRemoved": "Thank you. Your supporter key has been removed.", "MessageKeyRemoved": "Thank you. Your supporter key has been removed.",
"ErrorLaunchingChromecast": "There was an error launching chromecast. Please ensure your device is connected to your wireless network.", "ErrorLaunchingChromecast": "There was an error launching chromecast. Please ensure your device is connected to your wireless network.",
"ValueTimeLimitSingleHour": "Time limit: 1 hour", "ValueTimeLimitSingleHour": "Time limit: 1 hour",
"ValueTimeLimitMultiHour": "Time limit: {0} hours", "ValueTimeLimitMultiHour": "Time limit: {0} hours",
"HeaderSearch": "Search", "HeaderSearch": "Search",
"ValueDateCreated": "Date created: {0}", "ValueDateCreated": "Date created: {0}",
"LabelArtist": "Artist", "LabelArtist": "Artist",
@ -97,6 +97,10 @@
"LabelVersionInstalled": "{0} installed", "LabelVersionInstalled": "{0} installed",
"LabelNumberReviews": "{0} Reviews", "LabelNumberReviews": "{0} Reviews",
"LabelFree": "Free", "LabelFree": "Free",
"HeaderPlaybackError": "Playback Error",
"MessagePlaybackErrorNotAllowed": "You're currently not authorized to play this content. Please contact your system administrator for details.",
"MessagePlaybackErrorNoCompatibleStream": "No compatible streams are currently available. Please try again later.",
"MessagePlaybackErrorRateLimitExceeded": "Your playback rate limit has been exceeded. Please contact your system administrator for details.",
"HeaderSelectAudio": "Select Audio", "HeaderSelectAudio": "Select Audio",
"HeaderSelectSubtitles": "Select Subtitles", "HeaderSelectSubtitles": "Select Subtitles",
"ButtonMarkForRemoval": "Remove from device", "ButtonMarkForRemoval": "Remove from device",

View File

@ -304,8 +304,6 @@
<Compile Include="Sorting\StudioComparer.cs" /> <Compile Include="Sorting\StudioComparer.cs" />
<Compile Include="Sorting\VideoBitRateComparer.cs" /> <Compile Include="Sorting\VideoBitRateComparer.cs" />
<Compile Include="Sync\AppSyncProvider.cs" /> <Compile Include="Sync\AppSyncProvider.cs" />
<Compile Include="Sync\FolderSync\FolderSyncDataProvider.cs" />
<Compile Include="Sync\FolderSync\FolderSyncProvider.cs" />
<Compile Include="Sync\CloudSyncProfile.cs" /> <Compile Include="Sync\CloudSyncProfile.cs" />
<Compile Include="Sync\IHasSyncProfile.cs" /> <Compile Include="Sync\IHasSyncProfile.cs" />
<Compile Include="Sync\MediaSync.cs" /> <Compile Include="Sync\MediaSync.cs" />

View File

@ -13,13 +13,15 @@ using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.Photos namespace MediaBrowser.Server.Implementations.Photos
{ {
public class MusicDynamicImageProvider : BaseDynamicImageProvider<UserView>, ICustomMetadataProvider<UserView> public class DynamicImageProvider : BaseDynamicImageProvider<UserView>, ICustomMetadataProvider<UserView>
{ {
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
public MusicDynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths) : base(fileSystem, providerManager, applicationPaths) public DynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IUserManager userManager, ILibraryManager libraryManager) : base(fileSystem, providerManager, applicationPaths)
{ {
_userManager = userManager;
_libraryManager = libraryManager;
} }
protected override async Task<List<BaseItem>> GetItemsWithImages(IHasImages item) protected override async Task<List<BaseItem>> GetItemsWithImages(IHasImages item)

View File

@ -1,31 +0,0 @@
using MediaBrowser.Controller.Sync;
using MediaBrowser.Model.Sync;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.Sync.FolderSync
{
public class FolderSyncDataProvider : ISyncDataProvider
{
public Task<List<string>> GetServerItemIds(SyncTarget target, string serverId)
{
throw new NotImplementedException();
}
public Task AddOrUpdate(SyncTarget target, LocalItem item)
{
throw new NotImplementedException();
}
public Task Delete(SyncTarget target, string id)
{
throw new NotImplementedException();
}
public Task<LocalItem> Get(SyncTarget target, string id)
{
throw new NotImplementedException();
}
}
}

View File

@ -1,143 +0,0 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Sync;
using MediaBrowser.Model.Sync;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.Sync.FolderSync
{
public class FolderSyncProvider : IServerSyncProvider
{
private readonly IApplicationPaths _appPaths;
private readonly IUserManager _userManager;
public FolderSyncProvider(IApplicationPaths appPaths, IUserManager userManager)
{
_appPaths = appPaths;
_userManager = userManager;
}
public Task SendFile(string inputFile, string path, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken)
{
return Task.Run(() => File.Copy(inputFile, path, true), cancellationToken);
}
public Task DeleteFile(string path, SyncTarget target, CancellationToken cancellationToken)
{
return Task.Run(() => File.Delete(path), cancellationToken);
}
public Task<Stream> GetFile(string path, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken)
{
return Task.FromResult((Stream)File.OpenRead(path));
}
public string GetFullPath(IEnumerable<string> paths, SyncTarget target)
{
var account = GetSyncAccounts()
.FirstOrDefault(i => string.Equals(i.Id, target.Id, StringComparison.OrdinalIgnoreCase));
if (account == null)
{
throw new ArgumentException("Invalid SyncTarget supplied.");
}
var list = paths.ToList();
list.Insert(0, account.Path);
return Path.Combine(list.ToArray());
}
public string GetParentDirectoryPath(string path, SyncTarget target)
{
return Path.GetDirectoryName(path);
}
public Task<List<DeviceFileInfo>> GetFileSystemEntries(string path, SyncTarget target)
{
List<FileInfo> files;
try
{
files = new DirectoryInfo(path).EnumerateFiles("*", SearchOption.TopDirectoryOnly).ToList();
}
catch (DirectoryNotFoundException)
{
files = new List<FileInfo>();
}
return Task.FromResult(files.Select(i => new DeviceFileInfo
{
Name = i.Name,
Path = i.FullName
}).ToList());
}
public ISyncDataProvider GetDataProvider()
{
// If single instances are needed, manage them here
return new FolderSyncDataProvider();
}
public string Name
{
get { return "Folder Sync"; }
}
public IEnumerable<SyncTarget> GetSyncTargets(string userId)
{
return GetSyncAccounts()
.Where(i => i.UserIds.Contains(userId, StringComparer.OrdinalIgnoreCase))
.Select(GetSyncTarget);
}
public IEnumerable<SyncTarget> GetAllSyncTargets()
{
return GetSyncAccounts().Select(GetSyncTarget);
}
private SyncTarget GetSyncTarget(SyncAccount account)
{
return new SyncTarget
{
Id = account.Id,
Name = account.Name
};
}
private IEnumerable<SyncAccount> GetSyncAccounts()
{
return new List<SyncAccount>();
// Dummy this up
return _userManager
.Users
.Select(i => new SyncAccount
{
Id = i.Id.ToString("N"),
UserIds = new List<string> { i.Id.ToString("N") },
Path = Path.Combine(_appPaths.DataPath, "foldersync", i.Id.ToString("N")),
Name = i.Name + "'s Folder Sync"
});
}
// An internal class to manage all configured Folder Sync accounts for differnet users
class SyncAccount
{
public string Id { get; set; }
public string Name { get; set; }
public string Path { get; set; }
public List<string> UserIds { get; set; }
public SyncAccount()
{
UserIds = new List<string>();
}
}
}
}

View File

@ -1,5 +1,4 @@
using ImageMagickSharp; using MediaBrowser.Common.Implementations.Logging;
using MediaBrowser.Common.Implementations.Logging;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Implementations; using MediaBrowser.Server.Implementations;
using MediaBrowser.Server.Startup.Common; using MediaBrowser.Server.Startup.Common;

View File

@ -455,9 +455,7 @@
<Name>MediaBrowser.XbmcMetadata</Name> <Name>MediaBrowser.XbmcMetadata</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup />
<Folder Include="ImageMagickCoders\x86\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent> <PostBuildEvent>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.580</version> <version>3.0.581</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.580" /> <dependency id="MediaBrowser.Common" version="3.0.581" />
<dependency id="NLog" version="3.2.0.0" /> <dependency id="NLog" version="3.2.0.0" />
<dependency id="SimpleInjector" version="2.7.0" /> <dependency id="SimpleInjector" version="2.7.0" />
</dependencies> </dependencies>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.580</version> <version>3.0.581</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Model.Signed</id> <id>MediaBrowser.Model.Signed</id>
<version>3.0.580</version> <version>3.0.581</version>
<title>MediaBrowser.Model - Signed Edition</title> <title>MediaBrowser.Model - Signed Edition</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.580</version> <version>3.0.581</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.580" /> <dependency id="MediaBrowser.Common" version="3.0.581" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>