From b32f33a7af434c981b6fc5b59ee5359007c7afc0 Mon Sep 17 00:00:00 2001
From: addamanth <55258011+addamanth@users.noreply.github.com>
Date: Sat, 11 Feb 2023 02:19:57 +0300
Subject: [PATCH] Added config parameter Don't remove items from trakt (#196)
---
Trakt/Helpers/LibraryManagerEventsHelper.cs | 2 +-
Trakt/Model/TraktUser.cs | 6 ++++++
Trakt/Web/trakt.html | 9 +++++++++
Trakt/Web/trakt.js | 5 ++++-
4 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/Trakt/Helpers/LibraryManagerEventsHelper.cs b/Trakt/Helpers/LibraryManagerEventsHelper.cs
index 6e242cd..c592e47 100644
--- a/Trakt/Helpers/LibraryManagerEventsHelper.cs
+++ b/Trakt/Helpers/LibraryManagerEventsHelper.cs
@@ -73,7 +73,7 @@ internal class LibraryManagerEventsHelper : IDisposable
{
// Add to queue.
// Sync will be processed when the next timer elapsed event fires.
- if (user.SynchronizeCollections)
+ if (user.SynchronizeCollections && (!user.DontRemoveItemFromTrakt || eventType != EventType.Remove))
{
_queuedEvents.Add(new LibraryEvent { Item = item, TraktUser = user, EventType = eventType });
}
diff --git a/Trakt/Model/TraktUser.cs b/Trakt/Model/TraktUser.cs
index 566fd6b..33819af 100644
--- a/Trakt/Model/TraktUser.cs
+++ b/Trakt/Model/TraktUser.cs
@@ -30,6 +30,7 @@ public class TraktUser
Scrobble = true;
LocationsExcluded = null;
AccessTokenExpiration = DateTime.MinValue;
+ DontRemoveItemFromTrakt = true;
}
///
@@ -111,4 +112,9 @@ public class TraktUser
/// Gets or sets the access token expiration.
///
public DateTime AccessTokenExpiration { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether item should be removed from trakt.tv.
+ ///
+ public bool DontRemoveItemFromTrakt { get; set; }
}
diff --git a/Trakt/Web/trakt.html b/Trakt/Web/trakt.html
index 8fde701..6224593 100644
--- a/Trakt/Web/trakt.html
+++ b/Trakt/Web/trakt.html
@@ -136,6 +136,15 @@
Scrobble to trakt.tv.
+
+
+
+ When checked, the item removed from local collection will NOT be removed from trakt.tv collection.
+
+