aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/SyncPlay
diff options
context:
space:
mode:
authorgion <oancaionutandrei@gmail.com>2020-05-26 11:37:52 +0200
committergion <oancaionutandrei@gmail.com>2020-05-26 11:37:52 +0200
commite42bfc92f3e072a3d51dddce06bc90587e06791c (patch)
treeb436044e5886e310f8f5f1e466af13c042c90fda /Emby.Server.Implementations/SyncPlay
parente4838b0faa2dafec9382abe8e00bd18be624a030 (diff)
Fix code issues
Diffstat (limited to 'Emby.Server.Implementations/SyncPlay')
-rw-r--r--Emby.Server.Implementations/SyncPlay/SyncPlayController.cs37
-rw-r--r--Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs1
2 files changed, 4 insertions, 34 deletions
diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs
index c7bd242a7..d430d4d16 100644
--- a/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs
+++ b/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs
@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.SyncPlay
/// <remarks>
/// Class is not thread-safe, external locking is required when accessing methods.
/// </remarks>
- public class SyncPlayController : ISyncPlayController, IDisposable
+ public class SyncPlayController : ISyncPlayController
{
/// <summary>
/// Used to filter the sessions of a group.
@@ -65,8 +65,6 @@ namespace Emby.Server.Implementations.SyncPlay
/// <inheritdoc />
public bool IsGroupEmpty() => _group.IsEmpty();
- private bool _disposed = false;
-
public SyncPlayController(
ISessionManager sessionManager,
ISyncPlayManager syncPlayManager)
@@ -75,36 +73,6 @@ namespace Emby.Server.Implementations.SyncPlay
_syncPlayManager = syncPlayManager;
}
- /// <inheritdoc />
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- /// <summary>
- /// Releases unmanaged and optionally managed resources.
- /// </summary>
- /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
- protected virtual void Dispose(bool disposing)
- {
- if (_disposed)
- {
- return;
- }
-
- _disposed = true;
- }
-
- // TODO: use this somewhere
- private void CheckDisposed()
- {
- if (_disposed)
- {
- throw new ObjectDisposedException(GetType().Name);
- }
- }
-
/// <summary>
/// Converts DateTime to UTC string.
/// </summary>
@@ -518,6 +486,7 @@ namespace Emby.Server.Implementations.SyncPlay
var runTimeTicks = _group.PlayingItem.RunTimeTicks ?? 0;
ticks = ticks > runTimeTicks ? runTimeTicks : ticks;
}
+
return ticks;
}
@@ -541,7 +510,7 @@ namespace Emby.Server.Implementations.SyncPlay
PlayingItemName = _group.PlayingItem.Name,
PlayingItemId = _group.PlayingItem.Id.ToString(),
PositionTicks = _group.PositionTicks,
- Participants = _group.Participants.Values.Select(session => session.Session.UserName).Distinct().ToList().AsReadOnly()
+ Participants = _group.Participants.Values.Select(session => session.Session.UserName).Distinct().ToList()
};
}
}
diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
index 93cec1304..1f76dd4e3 100644
--- a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
+++ b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
@@ -374,6 +374,7 @@ namespace Emby.Server.Implementations.SyncPlay
{
throw new InvalidOperationException("Session in other group already!");
}
+
_sessionToGroupMap[session.Id] = group;
}