Skip to content

Commit

Permalink
Merge pull request #13291 from notspiff/video_tag_settings
Browse files Browse the repository at this point in the history
changed: added setting for use of video tags
  • Loading branch information
MartijnKaijser committed Jan 2, 2018
2 parents ba827f8 + acc1424 commit a4ad91e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
12 changes: 11 additions & 1 deletion addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -13574,7 +13574,17 @@ msgctxt "#21342"
msgid "There are currently no updates available for this add-on."
msgstr ""

#empty strings from id 21343 to 21357
#: system/settings.xml
msgctxt "#21343"
msgid "Use video tags"
msgstr ""

#: system/settings.xml
msgctxt "#21344"
msgid "If mp4 or mkv files have tags, use this for library metadata"
msgstr ""

#empty strings from id 21345 to 21357

#: system/settings/settings.xml
msgctxt "#21358"
Expand Down
5 changes: 5 additions & 0 deletions system/settings/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,11 @@
</constraints>
<control type="list" format="string" />
</setting>
<setting id="myvideos.usetags" type="boolean" label="21343" help="21344">
<level>2</level>
<default>false</default>
<control type="toggle" />
</setting>
<setting id="myvideos.extractflags" type="boolean" label="20433" help="36178">
<level>2</level>
<default>true</default>
Expand Down
1 change: 1 addition & 0 deletions xbmc/settings/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const std::string CSettings::SETTING_VIDEOPLAYER_USESTAGEFRIGHT = "videoplayer.u
const std::string CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE = "videoplayer.limitguiupdate";
const std::string CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC = "videoplayer.supportmvc";
const std::string CSettings::SETTING_MYVIDEOS_SELECTACTION = "myvideos.selectaction";
const std::string CSettings::SETTING_MYVIDEOS_USETAGS = "myvideos.usetags";
const std::string CSettings::SETTING_MYVIDEOS_EXTRACTFLAGS = "myvideos.extractflags";
const std::string CSettings::SETTING_MYVIDEOS_EXTRACTCHAPTERTHUMBS = "myvideos.extractchapterthumbs";
const std::string CSettings::SETTING_MYVIDEOS_REPLACELABELS = "myvideos.replacelabels";
Expand Down
1 change: 1 addition & 0 deletions xbmc/settings/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class CSettings : public CSettingsBase, public CSettingCreator, public CSettingC
static const std::string SETTING_VIDEOPLAYER_LIMITGUIUPDATE;
static const std::string SETTING_VIDEOPLAYER_SUPPORTMVC;
static const std::string SETTING_MYVIDEOS_SELECTACTION;
static const std::string SETTING_MYVIDEOS_USETAGS;
static const std::string SETTING_MYVIDEOS_EXTRACTFLAGS;
static const std::string SETTING_MYVIDEOS_EXTRACTCHAPTERTHUMBS;
static const std::string SETTING_MYVIDEOS_REPLACELABELS;
Expand Down
7 changes: 5 additions & 2 deletions xbmc/video/tags/VideoInfoTagLoaderFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
#include "VideoInfoTagLoaderFactory.h"
#include "VideoTagLoaderFFmpeg.h"
#include "VideoTagLoaderNFO.h"
#include "addons/AudioDecoder.h"
#include "FileItem.h"
#include "ServiceBroker.h"
#include "settings/Settings.h"

using namespace VIDEO;

Expand All @@ -38,7 +40,8 @@ IVideoInfoTagLoader* CVideoInfoTagLoaderFactory::CreateLoader(const CFileItem& i
return nfo;
delete nfo;

if (item.IsType(".mkv") || item.IsType(".mp4"))
if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_MYVIDEOS_USETAGS) &&
(item.IsType(".mkv") || item.IsType(".mp4")))
{
CVideoTagLoaderFFmpeg* ff = new CVideoTagLoaderFFmpeg(item, info, lookInFolder);
if (ff->HasInfo())
Expand Down

0 comments on commit a4ad91e

Please sign in to comment.