rename MediaVersions to MediaSources

This commit is contained in:
Luke Pulverenti 2014-03-22 12:16:43 -04:00
parent 327af0fe62
commit e2dee00cc0
25 changed files with 117 additions and 105 deletions

View File

@ -94,7 +94,7 @@ namespace MediaBrowser.Api
var item = _dtoService.GetItemByDtoId(request.ItemId);
var newLockData = request.LockData ?? false;
var dontFetchMetaChanged = item.DontFetchMeta != newLockData;
var dontFetchMetaChanged = item.IsLocked != newLockData;
UpdateItem(request, item);

View File

@ -1308,9 +1308,9 @@ namespace MediaBrowser.Api.Playback
RequestedUrl = url
};
var item = string.IsNullOrEmpty(request.MediaVersionId) ?
var item = string.IsNullOrEmpty(request.MediaSourceId) ?
DtoService.GetItemByDtoId(request.Id) :
DtoService.GetItemByDtoId(request.MediaVersionId);
DtoService.GetItemByDtoId(request.MediaSourceId);
if (user != null && item.GetPlayAccess(user) != PlayAccess.Full)
{

View File

@ -15,8 +15,8 @@ namespace MediaBrowser.Api.Playback
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public string Id { get; set; }
[ApiMember(Name = "MediaVersionId", Description = "The media version id, if playing an alternate version", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public string MediaVersionId { get; set; }
[ApiMember(Name = "MediaSourceId", Description = "The media version id, if playing an alternate version", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public string MediaSourceId { get; set; }
[ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string DeviceId { get; set; }

View File

@ -241,8 +241,8 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public string Id { get; set; }
[ApiMember(Name = "MediaVersionId", Description = "The id of the MediaVersion", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public string MediaVersionId { get; set; }
[ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public string MediaSourceId { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="UpdateUserItemRating" /> is likes.
@ -280,8 +280,8 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public string Id { get; set; }
[ApiMember(Name = "MediaVersionId", Description = "The id of the MediaVersion", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public string MediaVersionId { get; set; }
[ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public string MediaSourceId { get; set; }
/// <summary>
/// Gets or sets the position ticks.
@ -318,8 +318,8 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
public string Id { get; set; }
[ApiMember(Name = "MediaVersionId", Description = "The id of the MediaVersion", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
public string MediaVersionId { get; set; }
[ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
public string MediaSourceId { get; set; }
/// <summary>
/// Gets or sets the position ticks.
@ -746,7 +746,7 @@ namespace MediaBrowser.Api.UserLibrary
Item = item,
SessionId = GetSession().Id,
QueueableMediaTypes = queueableMediaTypes.Split(',').ToList(),
MediaVersionId = request.MediaVersionId
MediaSourceId = request.MediaSourceId
};
_sessionManager.OnPlaybackStart(info);
@ -769,7 +769,7 @@ namespace MediaBrowser.Api.UserLibrary
IsMuted = request.IsMuted,
IsPaused = request.IsPaused,
SessionId = GetSession().Id,
MediaVersionId = request.MediaVersionId
MediaSourceId = request.MediaSourceId
};
var task = _sessionManager.OnPlaybackProgress(info);
@ -794,7 +794,7 @@ namespace MediaBrowser.Api.UserLibrary
Item = item,
PositionTicks = request.PositionTicks,
SessionId = session.Id,
MediaVersionId = request.MediaVersionId
MediaSourceId = request.MediaSourceId
};
var task = _sessionManager.OnPlaybackStopped(info);

View File

@ -27,8 +27,8 @@ namespace MediaBrowser.Api
public string Id { get; set; }
}
[Route("/Videos/{Id}/AlternateVersions", "DELETE", Summary = "Assigns videos as alternates of another.")]
public class DeleteAlternateVersions : IReturnVoid
[Route("/Videos/{Id}/AlternateSources", "DELETE", Summary = "Removes alternate video sources.")]
public class DeleteAlternateSources : IReturnVoid
{
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
public string Id { get; set; }
@ -95,14 +95,14 @@ namespace MediaBrowser.Api
return ToOptimizedSerializedResultUsingCache(result);
}
public void Delete(DeleteAlternateVersions request)
public void Delete(DeleteAlternateSources request)
{
var task = RemoveAlternateVersions(request);
Task.WaitAll(task);
}
private async Task RemoveAlternateVersions(DeleteAlternateVersions request)
private async Task RemoveAlternateVersions(DeleteAlternateSources request)
{
var video = (Video)_dtoService.GetItemByDtoId(request.Id);
@ -143,7 +143,7 @@ namespace MediaBrowser.Api
var videos = items.Cast<Video>().ToList();
var videosWithVersions = videos.Where(i => i.AlternateVersionCount > 0)
var videosWithVersions = videos.Where(i => i.MediaSourceCount > 1)
.ToList();
if (videosWithVersions.Count > 1)
@ -155,14 +155,27 @@ namespace MediaBrowser.Api
if (primaryVersion == null)
{
primaryVersion = videos.OrderByDescending(i =>
primaryVersion = videos.OrderBy(i =>
{
if (i.Video3DFormat.HasValue)
{
return 1;
}
if (i.VideoType != Model.Entities.VideoType.VideoFile)
{
return 1;
}
return 0;
})
.ThenByDescending(i =>
{
var stream = i.GetDefaultVideoStream();
return stream == null || stream.Width == null ? 0 : stream.Width.Value;
}).ThenBy(i => i.Name.Length)
.First();
}).First();
}
foreach (var item in videos.Where(i => i.Id != primaryVersion.Id))

View File

@ -37,11 +37,11 @@ namespace MediaBrowser.Controller.Entities
}
[IgnoreDataMember]
public int AlternateVersionCount
public int MediaSourceCount
{
get
{
return LinkedAlternateVersions.Count + LocalAlternateVersionIds.Count;
return LinkedAlternateVersions.Count + LocalAlternateVersionIds.Count + 1;
}
}

View File

@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Library
public List<User> Users { get; set; }
public long? PlaybackPositionTicks { get; set; }
public BaseItem Item { get; set; }
public string MediaVersionId { get; set; }
public string MediaSourceId { get; set; }
public PlaybackProgressEventArgs()
{

View File

@ -39,6 +39,6 @@ namespace MediaBrowser.Controller.Session
/// Gets or sets the media version identifier.
/// </summary>
/// <value>The media version identifier.</value>
public string MediaVersionId { get; set; }
public string MediaSourceId { get; set; }
}
}

View File

@ -39,6 +39,6 @@ namespace MediaBrowser.Controller.Session
/// Gets or sets the media version identifier.
/// </summary>
/// <value>The media version identifier.</value>
public string MediaVersionId { get; set; }
public string MediaSourceId { get; set; }
}
}

View File

@ -27,6 +27,6 @@ namespace MediaBrowser.Controller.Session
/// Gets or sets the media version identifier.
/// </summary>
/// <value>The media version identifier.</value>
public string MediaVersionId { get; set; }
public string MediaSourceId { get; set; }
}
}

View File

@ -123,7 +123,7 @@ namespace MediaBrowser.Controller.Session
/// Gets or sets the now playing media version identifier.
/// </summary>
/// <value>The now playing media version identifier.</value>
public string NowPlayingMediaVersionId { get; set; }
public string NowPlayingMediaSourceId { get; set; }
/// <summary>

View File

@ -92,7 +92,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the media versions.
/// </summary>
/// <value>The media versions.</value>
public List<MediaVersionInfo> MediaVersions { get; set; }
public List<MediaSourceInfo> MediaSources { get; set; }
/// <summary>
/// Gets or sets the critic rating.
@ -500,7 +500,7 @@ namespace MediaBrowser.Model.Dto
/// </summary>
/// <value>The part count.</value>
public int? PartCount { get; set; }
public int? MediaVersionCount { get; set; }
public int? MediaSourceCount { get; set; }
/// <summary>
/// Determines whether the specified type is type.

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace MediaBrowser.Model.Dto
{
public class MediaVersionInfo
public class MediaSourceInfo
{
public string Id { get; set; }

View File

@ -74,7 +74,7 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the media version identifier.
/// </summary>
/// <value>The media version identifier.</value>
public string MediaVersionId { get; set; }
public string MediaSourceId { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has primary image.

View File

@ -84,7 +84,7 @@ namespace MediaBrowser.Model.Querying
/// <summary>
/// The media versions
/// </summary>
MediaVersions,
MediaSources,
/// <summary>
/// The metadata settings

View File

@ -10,7 +10,7 @@ namespace MediaBrowser.Model.Session
public string ItemId { get; set; }
public string MediaVersionId { get; set; }
public string MediaSourceId { get; set; }
public bool IsSeekable { get; set; }
@ -31,7 +31,7 @@ namespace MediaBrowser.Model.Session
public string ItemId { get; set; }
public string MediaVersionId { get; set; }
public string MediaSourceId { get; set; }
public long? PositionTicks { get; set; }
@ -49,7 +49,7 @@ namespace MediaBrowser.Model.Session
public string ItemId { get; set; }
public string MediaVersionId { get; set; }
public string MediaSourceId { get; set; }
public long? PositionTicks { get; set; }
}

View File

@ -213,7 +213,7 @@ namespace MediaBrowser.Providers.Savers
builder.Append("<Added>" + SecurityElement.Escape(item.DateCreated.ToLocalTime().ToString("G")) + "</Added>");
builder.Append("<LockData>" + item.DontFetchMeta.ToString().ToLower() + "</LockData>");
builder.Append("<LockData>" + item.IsLocked.ToString().ToLower() + "</LockData>");
if (item.LockedFields.Count > 0)
{

View File

@ -274,7 +274,7 @@ namespace MediaBrowser.Server.Implementations.Dto
if (session.NowPlayingItem != null)
{
dto.NowPlayingItem = GetNowPlayingInfo(session.NowPlayingItem, session.NowPlayingMediaVersionId, session.NowPlayingRunTimeTicks);
dto.NowPlayingItem = GetNowPlayingInfo(session.NowPlayingItem, session.NowPlayingMediaSourceId, session.NowPlayingRunTimeTicks);
}
if (session.UserId.HasValue)
@ -290,11 +290,11 @@ namespace MediaBrowser.Server.Implementations.Dto
/// Converts a BaseItem to a BaseItemInfo
/// </summary>
/// <param name="item">The item.</param>
/// <param name="mediaVersionId">The media version identifier.</param>
/// <param name="mediaSourceId">The media version identifier.</param>
/// <param name="nowPlayingRuntimeTicks">The now playing runtime ticks.</param>
/// <returns>BaseItemInfo.</returns>
/// <exception cref="System.ArgumentNullException">item</exception>
private BaseItemInfo GetNowPlayingInfo(BaseItem item, string mediaVersionId, long? nowPlayingRuntimeTicks)
private BaseItemInfo GetNowPlayingInfo(BaseItem item, string mediaSourceId, long? nowPlayingRuntimeTicks)
{
if (item == null)
{
@ -308,7 +308,7 @@ namespace MediaBrowser.Server.Implementations.Dto
MediaType = item.MediaType,
Type = item.GetClientTypeName(),
RunTimeTicks = nowPlayingRuntimeTicks,
MediaVersionId = mediaVersionId
MediaSourceId = mediaSourceId
};
info.PrimaryImageTag = GetImageCacheTag(item, ImageType.Primary);
@ -740,7 +740,7 @@ namespace MediaBrowser.Server.Implementations.Dto
if (fields.Contains(ItemFields.Settings))
{
dto.LockedFields = item.LockedFields;
dto.LockData = item.DontFetchMeta;
dto.LockData = item.IsLocked;
}
var hasBudget = item as IHasBudget;
@ -1063,8 +1063,8 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.AlbumPrimaryImageTag = GetImageCacheTag(albumParent, ImageType.Primary);
}
dto.MediaVersions = GetMediaVersions(audio);
dto.MediaVersionCount = 1;
dto.MediaSources = GetMediaSources(audio);
dto.MediaSourceCount = 1;
}
var album = item as MusicAlbum;
@ -1095,18 +1095,18 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.IsHD = video.IsHD;
dto.PartCount = video.AdditionalPartIds.Count + 1;
dto.MediaVersionCount = video.AlternateVersionCount + 1;
dto.MediaSourceCount = video.MediaSourceCount;
if (fields.Contains(ItemFields.MediaVersions))
if (fields.Contains(ItemFields.MediaSources))
{
dto.MediaVersions = GetMediaVersions(video);
dto.MediaSources = GetMediaSources(video);
}
if (fields.Contains(ItemFields.Chapters))
{
List<ChapterInfoDto> chapters;
if (dto.MediaVersions != null && dto.MediaVersions.Count > 0)
if (dto.MediaSources != null && dto.MediaSources.Count > 0)
{
chapters = _itemRepo.GetChapters(item.Id).Select(c => GetChapterInfoDto(c, item)).ToList();
}
@ -1130,9 +1130,9 @@ namespace MediaBrowser.Server.Implementations.Dto
{
List<MediaStream> mediaStreams;
if (dto.MediaVersions != null && dto.MediaVersions.Count > 0)
if (dto.MediaSources != null && dto.MediaSources.Count > 0)
{
mediaStreams = dto.MediaVersions.Where(i => i.IsPrimaryVersion)
mediaStreams = dto.MediaSources.Where(i => i.IsPrimaryVersion)
.SelectMany(i => i.MediaStreams)
.ToList();
}
@ -1267,7 +1267,7 @@ namespace MediaBrowser.Server.Implementations.Dto
}
}
private List<MediaVersionInfo> GetMediaVersions(Video item)
private List<MediaSourceInfo> GetMediaSources(Video item)
{
var result = item.GetAlternateVersions().Select(i => GetVersionInfo(i, false)).ToList();
@ -1293,9 +1293,9 @@ namespace MediaBrowser.Server.Implementations.Dto
.ToList();
}
private List<MediaVersionInfo> GetMediaVersions(Audio item)
private List<MediaSourceInfo> GetMediaSources(Audio item)
{
var result = new List<MediaVersionInfo>
var result = new List<MediaSourceInfo>
{
GetVersionInfo(item, true)
};
@ -1303,17 +1303,17 @@ namespace MediaBrowser.Server.Implementations.Dto
return result;
}
private MediaVersionInfo GetVersionInfo(Video i, bool isPrimary)
private MediaSourceInfo GetVersionInfo(Video i, bool isPrimary)
{
var mediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuery {ItemId = i.Id}).ToList();
var mediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuery { ItemId = i.Id }).ToList();
return new MediaVersionInfo
return new MediaSourceInfo
{
Id = i.Id.ToString("N"),
IsoType = i.IsoType,
LocationType = i.LocationType,
MediaStreams = mediaStreams,
Name = GetAlternateVersionName(i, mediaStreams),
Name = GetMediaSourceName(i, mediaStreams),
Path = GetMappedPath(i),
RunTimeTicks = i.RunTimeTicks,
Video3DFormat = i.Video3DFormat,
@ -1322,9 +1322,9 @@ namespace MediaBrowser.Server.Implementations.Dto
};
}
private MediaVersionInfo GetVersionInfo(Audio i, bool isPrimary)
private MediaSourceInfo GetVersionInfo(Audio i, bool isPrimary)
{
return new MediaVersionInfo
return new MediaSourceInfo
{
Id = i.Id.ToString("N"),
LocationType = i.LocationType,
@ -1355,7 +1355,7 @@ namespace MediaBrowser.Server.Implementations.Dto
return path;
}
private string GetAlternateVersionName(Video video, List<MediaStream> mediaStreams)
private string GetMediaSourceName(Video video, List<MediaStream> mediaStreams)
{
var terms = new List<string>();

View File

@ -47,7 +47,7 @@ namespace MediaBrowser.Server.Implementations.Library
EnsureName(item, args);
item.DontFetchMeta = item.Path.IndexOf("[dontfetchmeta]", StringComparison.OrdinalIgnoreCase) != -1 ||
item.Parents.Any(i => i.DontFetchMeta);
item.Parents.Any(i => i.IsLocked);
// Make sure DateCreated and DateModified have values
EntityResolutionHelper.EnsureDates(fileSystem, item, args, true);

View File

@ -190,7 +190,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
/// <param name="directoryService">The directory service.</param>
/// <param name="supportMultiFileItems">if set to <c>true</c> [support multi file items].</param>
/// <returns>Movie.</returns>
private T FindMovie<T>(string path, Folder parent, IEnumerable<FileSystemInfo> fileSystemEntries, IDirectoryService directoryService, bool supportMultiFileItems, bool supportsAlternateVersions)
private T FindMovie<T>(string path, Folder parent, IEnumerable<FileSystemInfo> fileSystemEntries, IDirectoryService directoryService, bool supportMultiFileItems, bool supportsMultipleSources)
where T : Video, new()
{
var movies = new List<T>();
@ -262,9 +262,9 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
return result;
}
}
if (supportsAlternateVersions)
if (supportsMultipleSources)
{
var result = GetMovieWithAlternateVersions(movies);
var result = GetMovieWithMultipleSources(movies);
if (result != null)
{
@ -393,7 +393,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
return null;
}
private T GetMovieWithAlternateVersions<T>(IEnumerable<T> movies)
private T GetMovieWithMultipleSources<T>(IEnumerable<T> movies)
where T : Video, new()
{
var sortedMovies = movies.OrderBy(i => i.Path).ToList();

View File

@ -218,26 +218,26 @@ namespace MediaBrowser.Server.Implementations.Session
/// </summary>
/// <param name="session">The session.</param>
/// <param name="item">The item.</param>
/// <param name="mediaVersionId">The media version identifier.</param>
/// <param name="mediaSourceId">The media version identifier.</param>
/// <param name="isPaused">if set to <c>true</c> [is paused].</param>
/// <param name="isMuted">if set to <c>true</c> [is muted].</param>
/// <param name="currentPositionTicks">The current position ticks.</param>
private void UpdateNowPlayingItem(SessionInfo session, BaseItem item, string mediaVersionId, bool isPaused, bool isMuted, long? currentPositionTicks = null)
private void UpdateNowPlayingItem(SessionInfo session, BaseItem item, string mediaSourceId, bool isPaused, bool isMuted, long? currentPositionTicks = null)
{
session.IsMuted = isMuted;
session.IsPaused = isPaused;
session.NowPlayingPositionTicks = currentPositionTicks;
session.NowPlayingItem = item;
session.LastActivityDate = DateTime.UtcNow;
session.NowPlayingMediaVersionId = mediaVersionId;
session.NowPlayingMediaSourceId = mediaSourceId;
if (string.IsNullOrWhiteSpace(mediaVersionId))
if (string.IsNullOrWhiteSpace(mediaSourceId))
{
session.NowPlayingRunTimeTicks = item.RunTimeTicks;
}
else
{
var version = _libraryManager.GetItemById(new Guid(mediaVersionId));
var version = _libraryManager.GetItemById(new Guid(mediaSourceId));
session.NowPlayingRunTimeTicks = version.RunTimeTicks;
}
@ -261,7 +261,7 @@ namespace MediaBrowser.Server.Implementations.Session
session.NowPlayingPositionTicks = null;
session.IsPaused = false;
session.NowPlayingRunTimeTicks = null;
session.NowPlayingMediaVersionId = null;
session.NowPlayingMediaSourceId = null;
}
}
@ -368,9 +368,9 @@ namespace MediaBrowser.Server.Implementations.Session
var item = info.Item;
var mediaVersionId = GetMediaVersionId(item, info.MediaVersionId);
var mediaSourceId = GetMediaSourceId(item, info.MediaSourceId);
UpdateNowPlayingItem(session, item, mediaVersionId, false, false);
UpdateNowPlayingItem(session, item, mediaSourceId, false, false);
session.CanSeek = info.CanSeek;
session.QueueableMediaTypes = info.QueueableMediaTypes;
@ -390,7 +390,7 @@ namespace MediaBrowser.Server.Implementations.Session
{
Item = item,
Users = users,
MediaVersionId = info.MediaVersionId
MediaSourceId = info.MediaSourceId
}, _logger);
}
@ -438,9 +438,9 @@ namespace MediaBrowser.Server.Implementations.Session
var session = Sessions.First(i => i.Id.Equals(info.SessionId));
var mediaVersionId = GetMediaVersionId(info.Item, info.MediaVersionId);
var mediaSourceId = GetMediaSourceId(info.Item, info.MediaSourceId);
UpdateNowPlayingItem(session, info.Item, mediaVersionId, info.IsPaused, info.IsMuted, info.PositionTicks);
UpdateNowPlayingItem(session, info.Item, mediaSourceId, info.IsPaused, info.IsMuted, info.PositionTicks);
var key = info.Item.GetUserDataKey();
@ -456,7 +456,7 @@ namespace MediaBrowser.Server.Implementations.Session
Item = info.Item,
Users = users,
PlaybackPositionTicks = info.PositionTicks,
MediaVersionId = mediaVersionId
MediaSourceId = mediaSourceId
}, _logger);
}
@ -516,7 +516,7 @@ namespace MediaBrowser.Server.Implementations.Session
playedToCompletion = await OnPlaybackStopped(user.Id, key, info.Item, info.PositionTicks).ConfigureAwait(false);
}
var mediaVersionId = GetMediaVersionId(info.Item, info.MediaVersionId);
var mediaSourceId = GetMediaSourceId(info.Item, info.MediaSourceId);
EventHelper.QueueEventIfNotNull(PlaybackStopped, this, new PlaybackStopEventArgs
{
@ -524,22 +524,22 @@ namespace MediaBrowser.Server.Implementations.Session
Users = users,
PlaybackPositionTicks = info.PositionTicks,
PlayedToCompletion = playedToCompletion,
MediaVersionId = mediaVersionId
MediaSourceId = mediaSourceId
}, _logger);
}
private string GetMediaVersionId(BaseItem item, string reportedMediaVersionId)
private string GetMediaSourceId(BaseItem item, string reportedMediaSourceId)
{
if (string.IsNullOrWhiteSpace(reportedMediaVersionId))
if (string.IsNullOrWhiteSpace(reportedMediaSourceId))
{
if (item is Video || item is Audio)
{
reportedMediaVersionId = item.Id.ToString("N");
reportedMediaSourceId = item.Id.ToString("N");
}
}
return reportedMediaVersionId;
return reportedMediaSourceId;
}
private async Task<bool> OnPlaybackStopped(Guid userId, string userDataKey, BaseItem item, long? positionTicks)

View File

@ -225,7 +225,7 @@ namespace MediaBrowser.Server.Implementations.Session
if (vals.Length > 3)
{
info.MediaVersionId = vals[3];
info.MediaSourceId = vals[3];
}
_sessionManager.OnPlaybackStart(info);
@ -272,7 +272,7 @@ namespace MediaBrowser.Server.Implementations.Session
if (vals.Length > 4)
{
info.MediaVersionId = vals[4];
info.MediaSourceId = vals[4];
}
_sessionManager.OnPlaybackProgress(info);
@ -316,7 +316,7 @@ namespace MediaBrowser.Server.Implementations.Session
if (vals.Length > 2)
{
info.MediaVersionId = vals[2];
info.MediaSourceId = vals[2];
}
_sessionManager.OnPlaybackStopped(info);

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
namespace MediaBrowser.Server.Implementations.Sorting

View File

@ -3791,7 +3791,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
* @param {String} userId
* @param {String} itemId
*/
self.reportPlaybackStart = function (userId, itemId, mediaVersionId, canSeek, queueableMediaTypes) {
self.reportPlaybackStart = function (userId, itemId, mediaSourceId, canSeek, queueableMediaTypes) {
if (!userId) {
throw new Error("null userId");
@ -3810,8 +3810,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
var msg = [itemId, canSeek, queueableMediaTypes];
if (mediaVersionId) {
msg.push(mediaVersionId);
if (mediaSourceId) {
msg.push(mediaSourceId);
}
self.sendWebSocketMessage("PlaybackStart", msg.join('|'));
@ -3825,8 +3825,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
QueueableMediaTypes: queueableMediaTypes
};
if (mediaVersionId) {
params.mediaVersionId = mediaVersionId;
if (mediaSourceId) {
params.mediaSourceId = mediaSourceId;
}
var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, params);
@ -3842,7 +3842,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
* @param {String} userId
* @param {String} itemId
*/
self.reportPlaybackProgress = function (userId, itemId, mediaVersionId, positionTicks, isPaused, isMuted) {
self.reportPlaybackProgress = function (userId, itemId, mediaSourceId, positionTicks, isPaused, isMuted) {
if (!userId) {
throw new Error("null userId");
@ -3861,7 +3861,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
msgData += "|" + (positionTicks == null ? "" : positionTicks);
msgData += "|" + (isPaused == null ? "" : isPaused);
msgData += "|" + (isMuted == null ? "" : isMuted);
msgData += "|" + (mediaVersionId == null ? "" : mediaVersionId);
msgData += "|" + (mediaSourceId == null ? "" : mediaSourceId);
self.sendWebSocketMessage("PlaybackProgress", msgData);
@ -3878,8 +3878,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
params.positionTicks = positionTicks;
}
if (mediaVersionId) {
params.mediaVersionId = mediaVersionId;
if (mediaSourceId) {
params.mediaSourceId = mediaSourceId;
}
var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId + "/Progress", params);
@ -3895,7 +3895,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
* @param {String} userId
* @param {String} itemId
*/
self.reportPlaybackStopped = function (userId, itemId, mediaVersionId, positionTicks) {
self.reportPlaybackStopped = function (userId, itemId, mediaSourceId, positionTicks) {
if (!userId) {
throw new Error("null userId");
@ -3911,7 +3911,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
var msg = itemId;
msg += "|" + (positionTicks == null ? "" : positionTicks);
msg += "|" + (mediaVersionId == null ? "" : mediaVersionId);
msg += "|" + (mediaSourceId == null ? "" : mediaSourceId);
self.sendWebSocketMessage("PlaybackStopped", msg);
@ -3925,8 +3925,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
params.positionTicks = positionTicks;
}
if (mediaVersionId) {
params.mediaVersionId = mediaVersionId;
if (mediaSourceId) {
params.mediaSourceId = mediaSourceId;
}
var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, params);

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.246" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.247" targetFramework="net45" />
</packages>