pull/702/head
Luke Pulverenti 10 years ago
parent 8b7ade8e9d
commit 6c3209e3f9

@ -515,7 +515,7 @@ namespace MediaBrowser.Dlna
public void Run()
{
//DumpProfiles();
DumpProfiles();
}
private void DumpProfiles()

@ -29,6 +29,7 @@ namespace MediaBrowser.Dlna.Profiles
TimelineOffsetSeconds = 40;
RequiresPlainFolders = true;
RequiresPlainVideoItems = true;
EnableMSMediaReceiverRegistrar = true;
Identification = new DeviceIdentification
{

@ -28,6 +28,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3,wma" type="Audio" />

@ -33,6 +33,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />

@ -34,6 +34,7 @@
<RequiresPlainFolders>true</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mpeg" audioCodec="mp2" videoCodec="mpeg2video" type="Video" />

@ -35,6 +35,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp4,mkv,mpeg,ts" audioCodec="mp3,ac3,aac,he-aac,pcm" videoCodec="h264,mpeg2video" type="Video" />

@ -34,6 +34,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="ts" audioCodec="aac,ac3,mp3" videoCodec="h264" type="Video" />

@ -32,6 +32,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />

@ -34,6 +34,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3" audioCodec="mp2,mp3" type="Audio" />

@ -35,6 +35,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes>
<XmlAttribute name="xmlns:pv" value="http://www.pv.com/pvns/" />
</XmlRootAttributes>

@ -28,6 +28,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp4,mov" audioCodec="aac" videoCodec="h264,mpeg4" type="Video" />

@ -34,6 +34,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes>
<XmlAttribute name="xmlns:sec" value="http://www.sec.co.kr/" />
</XmlRootAttributes>

@ -34,6 +34,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

@ -36,6 +36,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

@ -36,6 +36,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

@ -36,6 +36,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

@ -36,6 +36,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

@ -36,6 +36,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes>
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes>

@ -36,6 +36,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="avi" audioCodec="mp2,mp3" videoCodec="mpeg4" type="Video" />

@ -35,6 +35,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="avi" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video,mpeg4,h264,vc1" type="Video" />

@ -35,6 +35,7 @@
<RequiresPlainFolders>true</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>true</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="avi" audioCodec="ac3,mp3" videoCodec="mpeg4" type="Video" />

@ -35,6 +35,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="ts" audioCodec="ac3" videoCodec="h264" type="Video" />

@ -34,6 +34,7 @@
<RequiresPlainFolders>false</RequiresPlainFolders>
<SupportsDirectRemoteContent>false</SupportsDirectRemoteContent>
<SupportsCustomHttpHeaders>false</SupportsCustomHttpHeaders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes />
<DirectPlayProfiles>
<DirectPlayProfile container="mp3" audioCodec="mp2,mp3" type="Audio" />

@ -261,14 +261,17 @@ namespace MediaBrowser.Dlna.Server
EventSubUrl = "connectionmanager/events"
});
list.Add(new DeviceService
if (_profile.EnableMSMediaReceiverRegistrar)
{
ServiceType = "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1",
ServiceId = "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar",
ScpdUrl = "mediareceiverregistrar/mediareceiverregistrar.xml",
ControlUrl = "mediareceiverregistrar/control",
EventSubUrl = "mediareceiverregistrar/events"
});
list.Add(new DeviceService
{
ServiceType = "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1",
ServiceId = "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar",
ScpdUrl = "mediareceiverregistrar/mediareceiverregistrar.xml",
ControlUrl = "mediareceiverregistrar/control",
EventSubUrl = "mediareceiverregistrar/events"
});
}
return list;
}

@ -78,6 +78,7 @@ namespace MediaBrowser.Model.Dlna
public bool SupportsDirectRemoteContent { get; set; }
public bool SupportsCustomHttpHeaders { get; set; }
public bool EnableMSMediaReceiverRegistrar { get; set; }
public XmlAttribute[] XmlRootAttributes { get; set; }

@ -524,11 +524,6 @@ namespace MediaBrowser.Model.Dlna
{
if (subtitleStream != null)
{
if (!subtitleStream.IsTextSubtitleStream)
{
return false;
}
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options);
if (subtitleProfile.Method != SubtitleDeliveryMethod.External && subtitleProfile.Method != SubtitleDeliveryMethod.Embed)
@ -568,19 +563,6 @@ namespace MediaBrowser.Model.Dlna
};
}
private SubtitleProfile GetSubtitleProfile(SubtitleProfile[] profiles, SubtitleDeliveryMethod method, string[] formats)
{
foreach (SubtitleProfile profile in profiles)
{
if (method == profile.Method && ListHelper.ContainsIgnoreCase(formats, profile.Format))
{
return profile;
}
}
return null;
}
private SubtitleProfile GetSubtitleProfile(SubtitleProfile[] profiles, SubtitleDeliveryMethod method)
{
foreach (SubtitleProfile profile in profiles)

@ -1,4 +1,5 @@

using System.Collections.Generic;
namespace MediaBrowser.Model.Sync
{
public class SyncJobQuery
@ -14,11 +15,6 @@ namespace MediaBrowser.Model.Sync
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is completed.
/// </summary>
/// <value><c>null</c> if [is completed] contains no value, <c>true</c> if [is completed]; otherwise, <c>false</c>.</value>
public bool? IsCompleted { get; set; }
/// <summary>
/// Gets or sets the target identifier.
/// </summary>
/// <value>The target identifier.</value>
@ -28,5 +24,20 @@ namespace MediaBrowser.Model.Sync
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
/// <summary>
/// Gets or sets the status.
/// </summary>
/// <value>The status.</value>
public List<SyncJobStatus> Statuses { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [synchronize new content].
/// </summary>
/// <value><c>null</c> if [synchronize new content] contains no value, <c>true</c> if [synchronize new content]; otherwise, <c>false</c>.</value>
public bool? SyncNewContent { get; set; }
public SyncJobQuery()
{
Statuses = new List<SyncJobStatus>();
}
}
}

@ -89,8 +89,8 @@
"LabelFree": "Free",
"HeaderSelectAudio": "Select Audio",
"HeaderSelectSubtitles": "Select Subtitles",
"ButtonMarkForRemoval": "Mark for removal from device",
"ButtonUnmarkForRemoval": "Unmark for removal from device",
"ButtonMarkForRemoval": "Remove from device",
"ButtonUnmarkForRemoval": "Cancel removal from device",
"LabelDefaultStream": "(Default)",
"LabelForcedStream": "(Forced)",
"LabelDefaultForcedStream": "(Default/Forced)",

@ -308,11 +308,11 @@ namespace MediaBrowser.Server.Implementations.Sync
return new[] { item };
}
public async Task EnsureSyncJobs(CancellationToken cancellationToken)
public async Task EnsureSyncJobItems(CancellationToken cancellationToken)
{
var jobResult = _syncRepo.GetJobs(new SyncJobQuery
{
IsCompleted = false
SyncNewContent = true
});
foreach (var job in jobResult.Items)
@ -328,7 +328,7 @@ namespace MediaBrowser.Server.Implementations.Sync
public async Task Sync(IProgress<double> progress, CancellationToken cancellationToken)
{
await EnsureSyncJobs(cancellationToken).ConfigureAwait(false);
await EnsureSyncJobItems(cancellationToken).ConfigureAwait(false);
// If it already has a converting status then is must have been aborted during conversion
var result = _syncRepo.GetJobItems(new SyncJobItemQuery

@ -30,7 +30,8 @@ namespace MediaBrowser.Server.Implementations.Sync
private IDbCommand _deleteJobCommand;
private IDbCommand _deleteJobItemsCommand;
private IDbCommand _saveJobItemCommand;
private IDbCommand _insertJobItemCommand;
private IDbCommand _updateJobItemCommand;
private readonly IJsonSerializer _json;
@ -120,25 +121,45 @@ namespace MediaBrowser.Server.Implementations.Sync
_updateJobCommand.Parameters.Add(_updateJobCommand, "@DateLastModified");
_updateJobCommand.Parameters.Add(_updateJobCommand, "@ItemCount");
// _saveJobItemCommand
_saveJobItemCommand = _connection.CreateCommand();
_saveJobItemCommand.CommandText = "replace into SyncJobItems (Id, ItemId, ItemName, MediaSourceId, JobId, TemporaryPath, OutputPath, Status, TargetId, DateCreated, Progress, AdditionalFiles, MediaSource, IsMarkedForRemoval, JobItemIndex) values (@Id, @ItemId, @ItemName, @MediaSourceId, @JobId, @TemporaryPath, @OutputPath, @Status, @TargetId, @DateCreated, @Progress, @AdditionalFiles, @MediaSource, @IsMarkedForRemoval, @JobItemIndex)";
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@Id");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@ItemId");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@ItemName");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@MediaSourceId");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@JobId");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@TemporaryPath");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@OutputPath");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@Status");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@TargetId");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@DateCreated");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@Progress");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@AdditionalFiles");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@MediaSource");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@IsMarkedForRemoval");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@JobItemIndex");
// _insertJobItemCommand
_insertJobItemCommand = _connection.CreateCommand();
_insertJobItemCommand.CommandText = "insert into SyncJobItems (Id, ItemId, ItemName, MediaSourceId, JobId, TemporaryPath, OutputPath, Status, TargetId, DateCreated, Progress, AdditionalFiles, MediaSource, IsMarkedForRemoval, JobItemIndex) values (@Id, @ItemId, @ItemName, @MediaSourceId, @JobId, @TemporaryPath, @OutputPath, @Status, @TargetId, @DateCreated, @Progress, @AdditionalFiles, @MediaSource, @IsMarkedForRemoval, @JobItemIndex)";
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@Id");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@ItemId");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@ItemName");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@MediaSourceId");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@JobId");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@TemporaryPath");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@OutputPath");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@Status");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@TargetId");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@DateCreated");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@Progress");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@AdditionalFiles");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@MediaSource");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@IsMarkedForRemoval");
_insertJobItemCommand.Parameters.Add(_insertJobItemCommand, "@JobItemIndex");
// _updateJobItemCommand
_updateJobItemCommand = _connection.CreateCommand();
_updateJobItemCommand.CommandText = "update SyncJobItems set ItemId=@ItemId,ItemName=@ItemName,MediaSourceId=@MediaSourceId,JobId=@JobId,TemporaryPath=@TemporaryPath,OutputPath=@OutputPath,Status=@Status,TargetId=@TargetId,DateCreated=@DateCreated,Progress=@Progress,AdditionalFiles=@AdditionalFiles,MediaSource=@MediaSource,IsMarkedForRemoval=@IsMarkedForRemoval,JobItemIndex=@JobItemIndex where Id=@Id";
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@Id");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@ItemId");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@ItemName");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@MediaSourceId");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@JobId");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@TemporaryPath");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@OutputPath");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@Status");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@TargetId");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@DateCreated");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@Progress");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@AdditionalFiles");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@MediaSource");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@IsMarkedForRemoval");
_updateJobItemCommand.Parameters.Add(_updateJobItemCommand, "@JobItemIndex");
}
private const string BaseJobSelectText = "select Id, TargetId, Name, Quality, Status, Progress, UserId, ItemIds, Category, ParentId, UnwatchedOnly, ItemLimit, SyncNewContent, DateCreated, DateLastModified, ItemCount from SyncJobs";
@ -392,17 +413,11 @@ namespace MediaBrowser.Server.Implementations.Sync
var whereClauses = new List<string>();
if (query.IsCompleted.HasValue)
if (query.Statuses.Count > 0)
{
if (query.IsCompleted.Value)
{
whereClauses.Add("Status=@Status");
}
else
{
whereClauses.Add("Status<>@Status");
}
cmd.Parameters.Add(cmd, "@Status", DbType.String).Value = SyncJobStatus.Completed.ToString();
var statuses = string.Join(",", query.Statuses.Select(i => "'" + i.ToString() + "'").ToArray());
whereClauses.Add(string.Format("Status in ({0})", statuses));
}
if (!string.IsNullOrWhiteSpace(query.TargetId))
{
@ -413,6 +428,11 @@ namespace MediaBrowser.Server.Implementations.Sync
whereClauses.Add("UserId=@UserId");
cmd.Parameters.Add(cmd, "@UserId", DbType.String).Value = query.UserId;
}
if (query.SyncNewContent.HasValue)
{
whereClauses.Add("SyncNewContent=@SyncNewContent");
cmd.Parameters.Add(cmd, "@SyncNewContent", DbType.Boolean).Value = query.SyncNewContent.Value;
}
var whereTextWithoutPaging = whereClauses.Count == 0 ?
string.Empty :
@ -583,10 +603,15 @@ namespace MediaBrowser.Server.Implementations.Sync
public Task Create(SyncJobItem jobItem)
{
return Update(jobItem);
return InsertOrUpdate(jobItem, _insertJobItemCommand);
}
public Task Update(SyncJobItem jobItem)
{
return InsertOrUpdate(jobItem, _updateJobItemCommand);
}
public async Task Update(SyncJobItem jobItem)
private async Task InsertOrUpdate(SyncJobItem jobItem, IDbCommand cmd)
{
if (jobItem == null)
{
@ -603,25 +628,25 @@ namespace MediaBrowser.Server.Implementations.Sync
var index = 0;
_saveJobItemCommand.GetParameter(index++).Value = new Guid(jobItem.Id);
_saveJobItemCommand.GetParameter(index++).Value = jobItem.ItemId;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.ItemName;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.MediaSourceId;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.JobId;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.TemporaryPath;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.OutputPath;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.Status.ToString();
_saveJobItemCommand.GetParameter(index++).Value = jobItem.TargetId;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.DateCreated;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.Progress;
_saveJobItemCommand.GetParameter(index++).Value = _json.SerializeToString(jobItem.AdditionalFiles);
_saveJobItemCommand.GetParameter(index++).Value = jobItem.MediaSource == null ? null : _json.SerializeToString(jobItem.MediaSource);
_saveJobItemCommand.GetParameter(index++).Value = jobItem.IsMarkedForRemoval;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.JobItemIndex;
_saveJobItemCommand.Transaction = transaction;
_saveJobItemCommand.ExecuteNonQuery();
cmd.GetParameter(index++).Value = new Guid(jobItem.Id);
cmd.GetParameter(index++).Value = jobItem.ItemId;
cmd.GetParameter(index++).Value = jobItem.ItemName;
cmd.GetParameter(index++).Value = jobItem.MediaSourceId;
cmd.GetParameter(index++).Value = jobItem.JobId;
cmd.GetParameter(index++).Value = jobItem.TemporaryPath;
cmd.GetParameter(index++).Value = jobItem.OutputPath;
cmd.GetParameter(index++).Value = jobItem.Status.ToString();
cmd.GetParameter(index++).Value = jobItem.TargetId;
cmd.GetParameter(index++).Value = jobItem.DateCreated;
cmd.GetParameter(index++).Value = jobItem.Progress;
cmd.GetParameter(index++).Value = _json.SerializeToString(jobItem.AdditionalFiles);
cmd.GetParameter(index++).Value = jobItem.MediaSource == null ? null : _json.SerializeToString(jobItem.MediaSource);
cmd.GetParameter(index++).Value = jobItem.IsMarkedForRemoval;
cmd.GetParameter(index++).Value = jobItem.JobItemIndex;
cmd.Transaction = transaction;
cmd.ExecuteNonQuery();
transaction.Commit();
}

@ -129,7 +129,7 @@ namespace MediaBrowser.Server.Implementations.TV
// Get them in display order, then reverse
var allEpisodes = series.GetSeasons(user, true, true)
.Where(i => !i.IndexNumber.HasValue || i.IndexNumber.Value != 0)
.SelectMany(i => i.GetEpisodes(user, true, true))
.SelectMany(i => i.GetEpisodes(user))
.Reverse()
.ToList();

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.553</version>
<version>3.0.554</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.553" />
<dependency id="MediaBrowser.Common" version="3.0.554" />
<dependency id="NLog" version="3.1.0.0" />
<dependency id="SimpleInjector" version="2.6.1" />
</dependencies>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.553</version>
<version>3.0.554</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.553</version>
<version>3.0.554</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.553</version>
<version>3.0.554</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.553" />
<dependency id="MediaBrowser.Common" version="3.0.554" />
</dependencies>
</metadata>
<files>

Loading…
Cancel
Save