aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknown <dvukovic@gmx.de>2018-12-08 14:33:52 +0100
committerDaVukovic <dvukovic@gmx.de>2018-12-08 14:55:35 +0100
commit905a410cc56a7da2045b2ece36148cdfd2e396b4 (patch)
treee9e432c6cc5c2a59b0e55b23ead890bdf809dbd7
parent8cdec8f115777e9f43a81f9a5e2426e9e66d7313 (diff)
[settings] Hide episode thumb if unseen core wise
-rw-r--r--addons/resource.language.en_gb/resources/strings.po24
-rw-r--r--addons/skin.estuary/media/OverlaySpoiler.pngbin0 -> 4814 bytes
-rwxr-xr-xsystem/settings/settings.xml7
-rw-r--r--xbmc/settings/MediaSettings.cpp12
-rw-r--r--xbmc/settings/MediaSettings.h1
-rw-r--r--xbmc/settings/Settings.cpp1
-rw-r--r--xbmc/settings/Settings.h1
-rw-r--r--xbmc/video/VideoThumbLoader.cpp14
8 files changed, 54 insertions, 6 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 6e670c77df..9420c2afe4 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -12877,7 +12877,7 @@ msgstr ""
#: system/settings/settings.xml
msgctxt "#20369"
-msgid "Show plot for unwatched items"
+msgid "Show information for unwatched items"
msgstr ""
msgctxt "#20370"
@@ -18113,10 +18113,10 @@ msgctxt "#36140"
msgid "Choose which temperature unit is used for displaying temperatures in the user interface."
msgstr ""
-#. Description of setting with label #20369 "Show plot for unwatched items"
+#. Description of setting with label #20369 "Show information for unwatched items"
#: system/settings/settings.xml
msgctxt "#36141"
-msgid "Show plot information for unwatched media in the video library. The plot will be shown for the specific category you have selected. For example if 'Movies' is selected, the plot will be shown at the movie library, but will be hidden for TV shows and otherwise."
+msgid "Show information for unwatched media in the video library or hide them if not selected to prevent spoilers. Available options are 'Movie plot', 'Episode plot' and 'Episode thumb'."
msgstr ""
#. Description of setting with label #14106 "Speed unit"
@@ -21588,3 +21588,21 @@ msgstr ""
msgctxt "#39113"
msgid "Center Mix Level in dB relative to metadata or default (-3 dB)"
msgstr ""
+
+#. Label for "show information for unwatched items" setting option
+#: system/settings/settings.xml
+msgctxt "#39114"
+msgid "Episode thumb"
+msgstr ""
+
+#. Label for "show information for unwatched items" setting option
+#: system/settings/settings.xml
+msgctxt "#39115"
+msgid "Movie plot"
+msgstr ""
+
+#. Label for "show information for unwatched items" setting option
+#: system/settings/settings.xml
+msgctxt "#39116"
+msgid "Episode plot"
+msgstr ""
diff --git a/addons/skin.estuary/media/OverlaySpoiler.png b/addons/skin.estuary/media/OverlaySpoiler.png
new file mode 100644
index 0000000000..f67af16bff
--- /dev/null
+++ b/addons/skin.estuary/media/OverlaySpoiler.png
Binary files differ
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index ed201cc591..f87ac4b6f4 100755
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -970,11 +970,12 @@
</setting>
<setting id="videolibrary.showunwatchedplots" type="list[integer]" label="20369" help="36141">
<level>0</level>
- <default>0,1</default> <!-- Show plot for both -->
+ <default>0,1,2</default> <!-- Show plot for both -->
<constraints>
<options>
- <option label="20342">0</option> <!-- Show plot for unwatched movies only -->
- <option label="20343">1</option> <!-- Show plot for unwatched tv show episodes only -->
+ <option label="39115">0</option> <!-- Show plot for unwatched movies only -->
+ <option label="39116">1</option> <!-- Show plot for unwatched tv show episodes only -->
+ <option label="39114">2</option> <!-- Show thumb for unwatched tv show episodes only -->
</options>
<delimiter>,</delimiter>
</constraints>
diff --git a/xbmc/settings/MediaSettings.cpp b/xbmc/settings/MediaSettings.cpp
index 69d3888ae7..d2dc93fede 100644
--- a/xbmc/settings/MediaSettings.cpp
+++ b/xbmc/settings/MediaSettings.cpp
@@ -17,14 +17,17 @@
#include "dialogs/GUIDialogFileBrowser.h"
#include "settings/dialogs/GUIDialogLibExportSettings.h"
#include "guilib/LocalizeStrings.h"
+#include "interfaces/AnnouncementManager.h"
#include "interfaces/builtins/Builtins.h"
#include "music/MusicDatabase.h"
#include "music/MusicLibraryQueue.h"
#include "messaging/helpers/DialogHelper.h"
+#include "ServiceBroker.h"
#include "settings/lib/Setting.h"
#include "settings/Settings.h"
#include "storage/MediaManager.h"
#include "threads/SingleLock.h"
+#include "utils/log.h"
#include "utils/StringUtils.h"
#include "utils/XBMCTinyXML.h"
#include "utils/XMLUtils.h"
@@ -343,6 +346,15 @@ void CMediaSettings::OnSettingAction(std::shared_ptr<const CSetting> setting)
}
}
+void CMediaSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
+{
+ if (setting == nullptr)
+ return;
+
+ if (setting->GetId() == CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS)
+ CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnUpdate");
+}
+
int CMediaSettings::GetWatchedMode(const std::string &content) const
{
CSingleLock lock(m_critical);
diff --git a/xbmc/settings/MediaSettings.h b/xbmc/settings/MediaSettings.h
index 3ab6302344..93f480359e 100644
--- a/xbmc/settings/MediaSettings.h
+++ b/xbmc/settings/MediaSettings.h
@@ -39,6 +39,7 @@ public:
bool Save(TiXmlNode *settings) const override;
void OnSettingAction(std::shared_ptr<const CSetting> setting) override;
+ void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
void OnSettingsLoaded() override;
const CVideoSettings& GetDefaultVideoSettings() const { return m_defaultVideoSettings; }
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
index 432aa53550..9bba5402a1 100644
--- a/xbmc/settings/Settings.cpp
+++ b/xbmc/settings/Settings.cpp
@@ -833,6 +833,7 @@ void CSettings::InitializeISettingCallbacks()
settingSet.insert(CSettings::SETTING_VIDEOLIBRARY_CLEANUP);
settingSet.insert(CSettings::SETTING_VIDEOLIBRARY_IMPORT);
settingSet.insert(CSettings::SETTING_VIDEOLIBRARY_EXPORT);
+ settingSet.insert(CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS);
GetSettingsManager()->RegisterCallback(&CMediaSettings::GetInstance(), settingSet);
settingSet.clear();
diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h
index 41698194d4..95baba2a7e 100644
--- a/xbmc/settings/Settings.h
+++ b/xbmc/settings/Settings.h
@@ -376,6 +376,7 @@ public:
// values for SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS
static const int VIDEOLIBRARY_PLOTS_SHOW_UNWATCHED_MOVIES = 0;
static const int VIDEOLIBRARY_PLOTS_SHOW_UNWATCHED_TVSHOWEPISODES = 1;
+ static const int VIDEOLIBRARY_THUMB_SHOW_UNWATCHED_EPISODE = 2;
/*!
\brief Creates a new settings wrapper around a new settings manager.
diff --git a/xbmc/video/VideoThumbLoader.cpp b/xbmc/video/VideoThumbLoader.cpp
index 6000f65294..28dd92e477 100644
--- a/xbmc/video/VideoThumbLoader.cpp
+++ b/xbmc/video/VideoThumbLoader.cpp
@@ -24,6 +24,7 @@
#include "GUIUserMessages.h"
#include "music/MusicDatabase.h"
#include "settings/AdvancedSettings.h"
+#include "settings/lib/Setting.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
#include "cores/VideoSettings.h"
@@ -349,6 +350,19 @@ bool CVideoThumbLoader::LoadItemCached(CFileItem* pItem)
SetArt(*pItem, artwork);
}
+ // hide thumb if episode is unwatched
+ std::shared_ptr<CSettingList> setting(std::dynamic_pointer_cast<CSettingList>(
+ CServiceBroker::GetSettingsComponent()->GetSettings()->GetSetting(CSettings::SETTING_VIDEOLIBRARY_SHOWUNWATCHEDPLOTS)));
+ if (pItem->HasArt("thumb") && pItem->HasVideoInfoTag() &&
+ pItem->GetVideoInfoTag()->m_type == MediaTypeEpisode &&
+ pItem->GetVideoInfoTag()->GetPlayCount() == 0 &&
+ setting &&
+ !setting->FindIntInList(CSettings::VIDEOLIBRARY_THUMB_SHOW_UNWATCHED_EPISODE)
+ )
+ {
+ pItem->SetArt("thumb", "OverlaySpoiler.png");
+ }
+
m_videoDatabase->Close();
return true;