mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
added model classes for remote control
This commit is contained in:
@@ -7,6 +7,7 @@ using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||
|
||||
var filename = item.Album ?? string.Empty;
|
||||
|
||||
filename += album == null ? item.Id.ToString() + item.DateModified.Ticks : album.Id.ToString() + album.DateModified.Ticks;
|
||||
filename += album == null ? item.Id.ToString("N") + item.DateModified.Ticks : album.Id.ToString() + album.DateModified.Ticks;
|
||||
|
||||
var path = ImageCache.GetResourcePath(filename + "_primary", ".jpg");
|
||||
|
||||
|
||||
@@ -41,9 +41,6 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections =
|
||||
new ConcurrentDictionary<string, SessionInfo>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
private readonly ConcurrentDictionary<Guid, IWebSocketConnection> _websocketConnections =
|
||||
new ConcurrentDictionary<Guid, IWebSocketConnection>();
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [playback start].
|
||||
/// </summary>
|
||||
@@ -133,7 +130,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
var conn = GetConnection(clientType, deviceId, deviceName, user);
|
||||
|
||||
conn.NowPlayingPositionTicks = currentPositionTicks;
|
||||
conn.NowPlayingItem = DtoBuilder.GetBaseItemInfo(item);
|
||||
conn.NowPlayingItem = item;
|
||||
conn.LastActivityDate = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
@@ -149,7 +146,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
{
|
||||
var conn = GetConnection(clientType, deviceId, deviceName, user);
|
||||
|
||||
if (conn.NowPlayingItem != null && conn.NowPlayingItem.Id.Equals(item.Id.ToString()))
|
||||
if (conn.NowPlayingItem != null && conn.NowPlayingItem.Id == item.Id)
|
||||
{
|
||||
conn.NowPlayingItem = null;
|
||||
conn.NowPlayingPositionTicks = null;
|
||||
@@ -177,7 +174,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
|
||||
connection.DeviceName = deviceName;
|
||||
|
||||
connection.UserId = user == null ? null : user.Id.ToString();
|
||||
connection.UserId = user == null ? (Guid?)null : user.Id;
|
||||
|
||||
return connection;
|
||||
}
|
||||
@@ -366,7 +363,12 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
/// <param name="webSocket">The web socket.</param>
|
||||
public void IdentifyWebSocket(Guid sessionId, IWebSocketConnection webSocket)
|
||||
{
|
||||
_websocketConnections.AddOrUpdate(sessionId, webSocket, (key, existing) => webSocket);
|
||||
var session = AllConnections.FirstOrDefault(i => i.Id == sessionId);
|
||||
|
||||
if (session != null)
|
||||
{
|
||||
session.WebSocket = webSocket;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user