add new sync methods
This commit is contained in:
parent
ed31b883f4
commit
e92e036574
|
@ -154,6 +154,28 @@ namespace MediaBrowser.Controller.Library
|
|||
/// <value>The additional locations.</value>
|
||||
private List<string> AdditionalLocations { get; set; }
|
||||
|
||||
public bool HasParent<T>()
|
||||
where T : Folder
|
||||
{
|
||||
var parent = Parent;
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
var item = parent as T;
|
||||
|
||||
// Just in case the user decided to nest episodes.
|
||||
// Not officially supported but in some cases we can handle it.
|
||||
if (item == null)
|
||||
{
|
||||
item = parent.Parents.OfType<T>().FirstOrDefault();
|
||||
}
|
||||
|
||||
return item != null;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the additional location.
|
||||
/// </summary>
|
||||
|
@ -165,7 +187,7 @@ namespace MediaBrowser.Controller.Library
|
|||
{
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
|
||||
if (AdditionalLocations == null)
|
||||
{
|
||||
AdditionalLocations = new List<string>();
|
||||
|
@ -182,7 +204,7 @@ namespace MediaBrowser.Controller.Library
|
|||
{
|
||||
get
|
||||
{
|
||||
var paths = string.IsNullOrWhiteSpace(Path) ? new string[] {} : new[] {Path};
|
||||
var paths = string.IsNullOrWhiteSpace(Path) ? new string[] { } : new[] { Path };
|
||||
return AdditionalLocations == null ? paths : paths.Concat(AdditionalLocations);
|
||||
}
|
||||
}
|
||||
|
@ -199,7 +221,7 @@ namespace MediaBrowser.Controller.Library
|
|||
{
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
|
||||
return GetFileSystemEntryByPath(System.IO.Path.Combine(Path, name));
|
||||
}
|
||||
|
||||
|
@ -215,7 +237,7 @@ namespace MediaBrowser.Controller.Library
|
|||
{
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
|
||||
if (FileSystemDictionary != null)
|
||||
{
|
||||
FileSystemInfo entry;
|
||||
|
|
|
@ -1380,11 +1380,11 @@ namespace MediaBrowser.Model.ApiClient
|
|||
Task UpdateItem(BaseItemDto item);
|
||||
|
||||
/// <summary>
|
||||
/// Requests the synchronize.
|
||||
/// Creates the synchronize job.
|
||||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <returns>Task<SyncJob>.</returns>
|
||||
Task<SyncJob> RequestSync(SyncJobRequest request);
|
||||
Task<SyncJob> CreateSyncJob(SyncJobRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// Opens the web socket.
|
||||
|
|
|
@ -887,7 +887,7 @@ namespace MediaBrowser.Model.Dto
|
|||
[IgnoreDataMember]
|
||||
public bool IsVideo
|
||||
{
|
||||
get { return StringHelper.EqualsIgnoreCase(MediaType, MediaBrowser.Model.Entities.MediaType.Video); }
|
||||
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Video); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -897,7 +897,7 @@ namespace MediaBrowser.Model.Dto
|
|||
[IgnoreDataMember]
|
||||
public bool IsAudio
|
||||
{
|
||||
get { return StringHelper.EqualsIgnoreCase(MediaType, MediaBrowser.Model.Entities.MediaType.Audio); }
|
||||
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Audio); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -907,7 +907,7 @@ namespace MediaBrowser.Model.Dto
|
|||
[IgnoreDataMember]
|
||||
public bool IsGame
|
||||
{
|
||||
get { return StringHelper.EqualsIgnoreCase(MediaType, MediaBrowser.Model.Entities.MediaType.Game); }
|
||||
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Game); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -951,7 +951,13 @@ namespace MediaBrowser.Model.Dto
|
|||
[IgnoreDataMember]
|
||||
public bool IsArtist
|
||||
{
|
||||
get { return StringHelper.EqualsIgnoreCase(Type, "Artist"); }
|
||||
get { return StringHelper.EqualsIgnoreCase(Type, "MusicArtist"); }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsAlbum
|
||||
{
|
||||
get { return StringHelper.EqualsIgnoreCase(Type, "MusicAlbum"); }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
|
|
|
@ -362,6 +362,7 @@
|
|||
<Compile Include="Session\TranscodingInfo.cs" />
|
||||
<Compile Include="Session\UserDataChangeInfo.cs" />
|
||||
<Compile Include="Devices\ContentUploadHistory.cs" />
|
||||
<Compile Include="Sync\SyncHelper.cs" />
|
||||
<Compile Include="Sync\SyncJob.cs" />
|
||||
<Compile Include="Sync\SyncJobCreationResult.cs" />
|
||||
<Compile Include="Sync\SyncJobItem.cs" />
|
||||
|
@ -370,6 +371,7 @@
|
|||
<Compile Include="Sync\SyncJobQuery.cs" />
|
||||
<Compile Include="Sync\SyncJobRequest.cs" />
|
||||
<Compile Include="Sync\SyncJobStatus.cs" />
|
||||
<Compile Include="Sync\SyncOptions.cs" />
|
||||
<Compile Include="Sync\SyncQuality.cs" />
|
||||
<Compile Include="Sync\SyncTarget.cs" />
|
||||
<Compile Include="System\LogFile.cs" />
|
||||
|
|
51
MediaBrowser.Model/Sync/SyncHelper.cs
Normal file
51
MediaBrowser.Model/Sync/SyncHelper.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
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);
|
||||
options.Add(SyncOptions.UnwatchedOnly);
|
||||
break;
|
||||
}
|
||||
if (item.IsFolder && !item.IsMusicGenre && !item.IsArtist && !item.IsType("musicalbum") && !item.IsGameGenre)
|
||||
{
|
||||
options.Add(SyncOptions.Quality);
|
||||
options.Add(SyncOptions.UnwatchedOnly);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,11 +46,6 @@ namespace MediaBrowser.Model.Sync
|
|||
/// <value><c>true</c> if [unwatched only]; otherwise, <c>false</c>.</value>
|
||||
public bool UnwatchedOnly { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [remove when watched].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [remove when watched]; otherwise, <c>false</c>.</value>
|
||||
public bool RemoveWhenWatched { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [synchronize new content].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [synchronize new content]; otherwise, <c>false</c>.</value>
|
||||
|
|
|
@ -35,11 +35,6 @@ namespace MediaBrowser.Model.Sync
|
|||
/// <value><c>true</c> if [unwatched only]; otherwise, <c>false</c>.</value>
|
||||
public bool UnwatchedOnly { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [remove when watched].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [remove when watched]; otherwise, <c>false</c>.</value>
|
||||
public bool RemoveWhenWatched { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [synchronize new content].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [synchronize new content]; otherwise, <c>false</c>.</value>
|
||||
|
|
11
MediaBrowser.Model/Sync/SyncOptions.cs
Normal file
11
MediaBrowser.Model/Sync/SyncOptions.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
namespace MediaBrowser.Model.Sync
|
||||
{
|
||||
public enum SyncOptions
|
||||
{
|
||||
Name = 0,
|
||||
Quality = 1,
|
||||
UnwatchedOnly = 2,
|
||||
SyncNewContent
|
||||
}
|
||||
}
|
|
@ -1708,7 +1708,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
|
||||
public int? GetSeasonNumberFromPath(string path)
|
||||
{
|
||||
return SeriesResolver.GetSeasonNumberFromPath(path);
|
||||
return SeriesResolver.GetSeasonNumberFromPath(path, CollectionType.TvShows);
|
||||
}
|
||||
|
||||
public int? GetSeasonNumberFromEpisodeFile(string path)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
|
@ -9,10 +8,10 @@ using MediaBrowser.Controller.Resolvers;
|
|||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Naming.Audio;
|
||||
using MediaBrowser.Naming.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using MediaBrowser.Naming.Common;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
{
|
||||
|
@ -53,10 +52,10 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
|||
//Avoid mis-identifying top folders
|
||||
if (args.Parent == null) return null;
|
||||
if (args.Parent.IsRoot) return null;
|
||||
if (args.Parent is MusicAlbum) return null;
|
||||
if (args.HasParent<MusicAlbum>()) return null;
|
||||
|
||||
// Optimization
|
||||
if (args.Parent is BoxSet || args.Parent is Series || args.Parent is Season)
|
||||
if (args.HasParent<BoxSet>() || args.HasParent<Series>() || args.HasParent<Season>())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -51,13 +51,13 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
|||
if (args.Parent.IsRoot) return null;
|
||||
|
||||
// Don't allow nested artists
|
||||
if (args.Parent is MusicArtist)
|
||||
if (args.HasParent<MusicArtist>() || args.HasParent<MusicAlbum>())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Optimization
|
||||
if (args.Parent is BoxSet || args.Parent is Series || args.Parent is Season)
|
||||
if (args.HasParent<BoxSet>() || args.HasParent<Series>() || args.HasParent<Season>())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -456,7 +456,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
// Don't do any resolving within a series structure
|
||||
if (string.IsNullOrEmpty(collectionType))
|
||||
{
|
||||
if (parent is Season || parent is Series)
|
||||
if (HasParent<Series>(parent) || HasParent<Season>(parent))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -480,5 +480,25 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
|
||||
return !validCollectionTypes.Contains(collectionType ?? string.Empty, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private bool HasParent<T>(Folder parent)
|
||||
where T : Folder
|
||||
{
|
||||
if (parent != null)
|
||||
{
|
||||
var item = parent as T;
|
||||
|
||||
// Just in case the user decided to nest episodes.
|
||||
// Not officially supported but in some cases we can handle it.
|
||||
if (item == null)
|
||||
{
|
||||
item = parent.Parents.OfType<T>().FirstOrDefault();
|
||||
}
|
||||
|
||||
return item != null;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
||||
{
|
||||
|
@ -34,7 +35,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
|||
{
|
||||
var season = new Season
|
||||
{
|
||||
IndexNumber = SeriesResolver.GetSeasonNumberFromPath(args.Path)
|
||||
IndexNumber = SeriesResolver.GetSeasonNumberFromPath(args.Path, CollectionType.TvShows)
|
||||
};
|
||||
|
||||
if (season.IndexNumber.HasValue && season.IndexNumber.Value == 0)
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
|||
}
|
||||
|
||||
// Optimization to avoid running these tests against Seasons
|
||||
if (args.Parent is Series || args.Parent is Season || args.Parent is MusicArtist || args.Parent is MusicAlbum)
|
||||
if (args.HasParent<Series>() || args.HasParent<Season>() || args.HasParent<MusicArtist>() || args.HasParent<MusicAlbum>())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
|||
return null;
|
||||
}
|
||||
|
||||
if (IsSeriesFolder(args.Path, isTvShowsFolder, args.FileSystemChildren, args.DirectoryService, _fileSystem, _logger, _libraryManager))
|
||||
if (IsSeriesFolder(args.Path, collectionType, args.FileSystemChildren, args.DirectoryService, _fileSystem, _logger, _libraryManager))
|
||||
{
|
||||
return new Series
|
||||
{
|
||||
|
@ -95,14 +95,14 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
|||
/// Determines whether [is series folder] [the specified path].
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="considerSeasonlessEntries">if set to <c>true</c> [consider seasonless entries].</param>
|
||||
/// <param name="collectionType">Type of the collection.</param>
|
||||
/// <param name="fileSystemChildren">The file system children.</param>
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <param name="fileSystem">The file system.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <returns><c>true</c> if [is series folder] [the specified path]; otherwise, <c>false</c>.</returns>
|
||||
public static bool IsSeriesFolder(string path, bool considerSeasonlessEntries, IEnumerable<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService, IFileSystem fileSystem, ILogger logger, ILibraryManager libraryManager)
|
||||
public static bool IsSeriesFolder(string path, string collectionType, IEnumerable<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService, IFileSystem fileSystem, ILogger logger, ILibraryManager libraryManager)
|
||||
{
|
||||
foreach (var child in fileSystemChildren)
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
|||
|
||||
if ((attributes & FileAttributes.Directory) == FileAttributes.Directory)
|
||||
{
|
||||
if (IsSeasonFolder(child.FullName, directoryService, fileSystem))
|
||||
if (IsSeasonFolder(child.FullName, collectionType, directoryService, fileSystem))
|
||||
{
|
||||
//logger.Debug("{0} is a series because of season folder {1}.", path, child.FullName);
|
||||
return true;
|
||||
|
@ -135,7 +135,9 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
|||
|
||||
if (libraryManager.IsVideoFile(fullName) || IsVideoPlaceHolder(fullName))
|
||||
{
|
||||
if (GetEpisodeNumberFromFile(fullName, considerSeasonlessEntries).HasValue)
|
||||
var isTvShowsFolder = string.Equals(collectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (GetEpisodeNumberFromFile(fullName, isTvShowsFolder).HasValue)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -169,12 +171,13 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
|||
/// Determines whether [is season folder] [the specified path].
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="collectionType">Type of the collection.</param>
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <param name="fileSystem">The file system.</param>
|
||||
/// <returns><c>true</c> if [is season folder] [the specified path]; otherwise, <c>false</c>.</returns>
|
||||
private static bool IsSeasonFolder(string path, IDirectoryService directoryService, IFileSystem fileSystem)
|
||||
private static bool IsSeasonFolder(string path, string collectionType, IDirectoryService directoryService, IFileSystem fileSystem)
|
||||
{
|
||||
var seasonNumber = GetSeasonNumberFromPath(path);
|
||||
var seasonNumber = GetSeasonNumberFromPath(path, collectionType);
|
||||
var hasSeasonNumber = seasonNumber != null;
|
||||
|
||||
if (!hasSeasonNumber)
|
||||
|
@ -309,18 +312,27 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
|||
// "blah - 01.avi", "blah 2 - 01.avi", "blah - 01 blah.avi", "blah 2 - 01 blah", "blah - 01 - blah.avi", "blah 2 - 01 - blah"
|
||||
};
|
||||
|
||||
public static int? GetSeasonNumberFromPath(string path)
|
||||
{
|
||||
return GetSeasonNumberFromPath(path, CollectionType.TvShows);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the season number from path.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="collectionType">Type of the collection.</param>
|
||||
/// <returns>System.Nullable{System.Int32}.</returns>
|
||||
public static int? GetSeasonNumberFromPath(string path)
|
||||
public static int? GetSeasonNumberFromPath(string path, string collectionType)
|
||||
{
|
||||
var filename = Path.GetFileName(path);
|
||||
|
||||
if (string.Equals(filename, "specials", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(collectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return 0;
|
||||
if (string.Equals(filename, "specials", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int val;
|
||||
|
|
|
@ -84,7 +84,6 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
DateCreated = DateTime.UtcNow,
|
||||
DateLastModified = DateTime.UtcNow,
|
||||
SyncNewContent = request.SyncNewContent,
|
||||
RemoveWhenWatched = request.RemoveWhenWatched,
|
||||
ItemCount = items.Count,
|
||||
Quality = request.Quality
|
||||
};
|
||||
|
|
|
@ -35,13 +35,13 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
|
||||
public async Task Initialize()
|
||||
{
|
||||
var dbFile = Path.Combine(_appPaths.DataPath, "sync4.db");
|
||||
var dbFile = Path.Combine(_appPaths.DataPath, "sync5.db");
|
||||
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
|
||||
|
||||
string[] queries = {
|
||||
|
||||
"create table if not exists SyncJobs (Id GUID PRIMARY KEY, TargetId TEXT NOT NULL, Name TEXT NOT NULL, Quality TEXT NOT NULL, Status TEXT NOT NULL, Progress FLOAT, UserId TEXT NOT NULL, ItemIds TEXT NOT NULL, UnwatchedOnly BIT, ItemLimit INT, RemoveWhenWatched BIT, SyncNewContent BIT, DateCreated DateTime, DateLastModified DateTime, ItemCount int)",
|
||||
"create table if not exists SyncJobs (Id GUID PRIMARY KEY, TargetId TEXT NOT NULL, Name TEXT NOT NULL, Quality TEXT NOT NULL, Status TEXT NOT NULL, Progress FLOAT, UserId TEXT NOT NULL, ItemIds TEXT NOT NULL, UnwatchedOnly BIT, ItemLimit INT, SyncNewContent BIT, DateCreated DateTime, DateLastModified DateTime, ItemCount int)",
|
||||
"create index if not exists idx_SyncJobs on SyncJobs(Id)",
|
||||
|
||||
"create table if not exists SyncJobItems (Id GUID PRIMARY KEY, ItemId TEXT, JobId TEXT, OutputPath TEXT, Status TEXT, TargetId TEXT, DateCreated DateTime, Progress FLOAT)",
|
||||
|
@ -65,7 +65,7 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
_deleteJobCommand.Parameters.Add(_deleteJobCommand, "@Id");
|
||||
|
||||
_saveJobCommand = _connection.CreateCommand();
|
||||
_saveJobCommand.CommandText = "replace into SyncJobs (Id, TargetId, Name, Quality, Status, Progress, UserId, ItemIds, UnwatchedOnly, ItemLimit, RemoveWhenWatched, SyncNewContent, DateCreated, DateLastModified, ItemCount) values (@Id, @TargetId, @Name, @Quality, @Status, @Progress, @UserId, @ItemIds, @UnwatchedOnly, @ItemLimit, @RemoveWhenWatched, @SyncNewContent, @DateCreated, @DateLastModified, @ItemCount)";
|
||||
_saveJobCommand.CommandText = "replace into SyncJobs (Id, TargetId, Name, Quality, Status, Progress, UserId, ItemIds, UnwatchedOnly, ItemLimit, SyncNewContent, DateCreated, DateLastModified, ItemCount) values (@Id, @TargetId, @Name, @Quality, @Status, @Progress, @UserId, @ItemIds, @UnwatchedOnly, @ItemLimit, @SyncNewContent, @DateCreated, @DateLastModified, @ItemCount)";
|
||||
|
||||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@Id");
|
||||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@TargetId");
|
||||
|
@ -77,7 +77,6 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@ItemIds");
|
||||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@UnwatchedOnly");
|
||||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@ItemLimit");
|
||||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@RemoveWhenWatched");
|
||||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@SyncNewContent");
|
||||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@DateCreated");
|
||||
_saveJobCommand.Parameters.Add(_saveJobCommand, "@DateLastModified");
|
||||
|
@ -96,7 +95,7 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
_saveJobItemCommand.Parameters.Add(_saveJobCommand, "@Progress");
|
||||
}
|
||||
|
||||
private const string BaseJobSelectText = "select Id, TargetId, Name, Quality, Status, Progress, UserId, ItemIds, UnwatchedOnly, ItemLimit, RemoveWhenWatched, SyncNewContent, DateCreated, DateLastModified, ItemCount from SyncJobs";
|
||||
private const string BaseJobSelectText = "select Id, TargetId, Name, Quality, Status, Progress, UserId, ItemIds, UnwatchedOnly, ItemLimit, SyncNewContent, DateCreated, DateLastModified, ItemCount from SyncJobs";
|
||||
private const string BaseJobItemSelectText = "select Id, ItemId, JobId, OutputPath, Status, TargetId, DateCreated, Progress from SyncJobItems";
|
||||
|
||||
public SyncJob GetJob(string id)
|
||||
|
@ -175,12 +174,11 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
info.ItemLimit = reader.GetInt32(9);
|
||||
}
|
||||
|
||||
info.RemoveWhenWatched = reader.GetBoolean(10);
|
||||
info.SyncNewContent = reader.GetBoolean(11);
|
||||
info.SyncNewContent = reader.GetBoolean(10);
|
||||
|
||||
info.DateCreated = reader.GetDateTime(12).ToUniversalTime();
|
||||
info.DateLastModified = reader.GetDateTime(13).ToUniversalTime();
|
||||
info.ItemCount = reader.GetInt32(14);
|
||||
info.DateCreated = reader.GetDateTime(11).ToUniversalTime();
|
||||
info.DateLastModified = reader.GetDateTime(12).ToUniversalTime();
|
||||
info.ItemCount = reader.GetInt32(13);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
@ -217,7 +215,6 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
_saveJobCommand.GetParameter(index++).Value = string.Join(",", job.RequestedItemIds.ToArray());
|
||||
_saveJobCommand.GetParameter(index++).Value = job.UnwatchedOnly;
|
||||
_saveJobCommand.GetParameter(index++).Value = job.ItemLimit;
|
||||
_saveJobCommand.GetParameter(index++).Value = job.RemoveWhenWatched;
|
||||
_saveJobCommand.GetParameter(index++).Value = job.SyncNewContent;
|
||||
_saveJobCommand.GetParameter(index++).Value = job.DateCreated;
|
||||
_saveJobCommand.GetParameter(index++).Value = job.DateLastModified;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.518</version>
|
||||
<version>3.0.519</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<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>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.518" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.519" />
|
||||
<dependency id="NLog" version="3.1.0.0" />
|
||||
<dependency id="SimpleInjector" version="2.6.1" />
|
||||
<dependency id="sharpcompress" version="0.10.2" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.518</version>
|
||||
<version>3.0.519</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Model.Signed</id>
|
||||
<version>3.0.518</version>
|
||||
<version>3.0.519</version>
|
||||
<title>MediaBrowser.Model - Signed Edition</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.518</version>
|
||||
<version>3.0.519</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.518" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.519" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("3.0.*")]
|
||||
//[assembly: AssemblyVersion("3.0.5462.0")]
|
||||
//[assembly: AssemblyVersion("3.0.5462.1")]
|
||||
|
|
Loading…
Reference in New Issue
Block a user