Skip to content

Commit

Permalink
add option to set default recording group as root for recordings
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Nov 28, 2018
1 parent 4af1fb7 commit 86bca27
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pvr.mythtv/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- [backport] Add option to set default recording grouo as root for recordings

v4.18.0
- Backport fixes and improvements from addon 5.10.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ msgctxt "#30068"
msgid "Use bookmarks of the backend MythTV"
msgstr "Brug bogmærker fra MythTV backenden"

msgctxt "#30069"
msgid "Show default recording group as root"
msgstr "Vis standard optagegruppe som root"

msgctxt "#30100"
msgid "Protocol version: %i - Database version: %i"
msgstr "Protokolversion: %i - Databaseversion: %i"
Expand Down
16 changes: 16 additions & 0 deletions pvr.mythtv/resources/language/resource.language.de_de/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,22 @@ msgctxt "#30065"
msgid "Limit channel tuning attempts"
msgstr "Reduzieren versuche tuning"

msgctxt "#30066"
msgid "Show inactive upcomings (alternative/recorded/expired)"
msgstr "Zeige inaktive bevorstehende Aufnahmen (alternativ/aufgenommen/abgelaufen)"

msgctxt "#30067"
msgid "Show LiveTV recordings"
msgstr "LiveTV-Aufnahmen anzeigen"

msgctxt "#30068"
msgid "Use bookmarks of the backend MythTV"
msgstr "Verwenden Sie Lesezeichen des Backends MythTV"

msgctxt "#30069"
msgid "Show default recording group as root"
msgstr "Standardaufzeichnungsgruppe als root anzeigen"

msgctxt "#30100"
msgid "Protocol version: %i - Database version: %i"
msgstr "Protokollversion: %i - Datenbankversion: %i"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ msgctxt "#30068"
msgid "Use bookmarks of the backend MythTV"
msgstr ""

# empty strings from id 30069 to 30099
msgctxt "#30069"
msgid "Show default recording group as root"
msgstr ""

# empty strings from id 30070 to 30099

# Systeminformation labels
msgctxt "#30100"
Expand Down
12 changes: 12 additions & 0 deletions pvr.mythtv/resources/language/resource.language.es_es/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ msgctxt "#30066"
msgid "Show inactive upcomings (alternative/recorded/expired)"
msgstr "Mostrar Proximamente inactivos (alternativos/grabados/expirados)"

msgctxt "#30067"
msgid "Show LiveTV recordings"
msgstr "Mostrar grabaciones de TV en Directo"

msgctxt "#30068"
msgid "Use bookmarks of the backend MythTV"
msgstr "Usa los marcadores del backend MythTV"

msgctxt "#30069"
msgid "Show default recording group as root"
msgstr "Mostrar el grupo predeterminado como la raíz"

msgctxt "#30100"
msgid "Protocol version: %i - Database version: %i"
msgstr "Versión de protocolo: %i - Versión de base de datos: %i"
Expand Down
12 changes: 12 additions & 0 deletions pvr.mythtv/resources/language/resource.language.es_mx/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ msgctxt "#30066"
msgid "Show inactive upcomings (alternative/recorded/expired)"
msgstr "Mostrar actualizaciones inactivas (alternativas / grabadas / caducadas)"

msgctxt "#30067"
msgid "Show LiveTV recordings"
msgstr "Mostrar grabaciones de TV en Directo"

msgctxt "#30068"
msgid "Use bookmarks of the backend MythTV"
msgstr "Usa los marcadores del backend MythTV"

msgctxt "#30069"
msgid "Show default recording group as root"
msgstr "Mostrar el grupo predeterminado como la raíz"

msgctxt "#30100"
msgid "Protocol version: %i - Database version: %i"
msgstr "Versión del protocolo:%i - Versión de la base de datos: %i"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ msgctxt "#30068"
msgid "Use bookmarks of the backend MythTV"
msgstr "Utiliser les signets du serveur MythTV"

msgctxt "#30069"
msgid "Show default recording group as root"
msgstr "Afficher le groupe par défaut à la racine"

msgctxt "#30100"
msgid "Protocol version: %i - Database version: %i"
msgstr "Version du protocole : %i - Version de la base de données : %i"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ msgctxt "#30068"
msgid "Use bookmarks of the backend MythTV"
msgstr "Utiliser les signets du serveur MythTV"

msgctxt "#30069"
msgid "Show default recording group as root"
msgstr "Afficher le groupe par défaut à la racine"

msgctxt "#30100"
msgid "Protocol version: %i - Database version: %i"
msgstr "Version du protocole : %i - Version de la base de données : %i"
Expand Down
16 changes: 16 additions & 0 deletions pvr.mythtv/resources/language/resource.language.nl_nl/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,22 @@ msgctxt "#30065"
msgid "Limit channel tuning attempts"
msgstr "Limiteer kanaal tuning pogingen"

msgctxt "#30066"
msgid "Show inactive upcomings (alternative/recorded/expired)"
msgstr "Toon inactieve aankomende (alternatief/opgenomen/verlopen)"

msgctxt "#30067"
msgid "Show LiveTV recordings"
msgstr "Toon LiveTV opnamen"

msgctxt "#30068"
msgid "Use bookmarks of the backend MythTV"
msgstr "Gebruik bladwijzers van de backend MythTV"

msgctxt "#30069"
msgid "Show default recording group as root"
msgstr "Toon standaard opnamegroep als root"

msgctxt "#30100"
msgid "Protocol version: %i - Database version: %i"
msgstr "Protocol versie: %i - Database versie: %i"
Expand Down
1 change: 1 addition & 0 deletions pvr.mythtv/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<setting id="enable_edl" type="enum" label="30058" lvalues="30059|30060|30061" default="0" />
<setting id="inactive_upcomings" type="bool" label="30066" default="true" />
<setting id="prompt_delete" type="bool" label="30047" default="false" />
<setting id="root_default_group" type="bool" label="30069" default="false" />
</category>
<category label="30049">
<setting id="rec_template_provider" type="enum" label="30020" lvalues="30021|30022" default="1" />
Expand Down
18 changes: 18 additions & 0 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ bool g_bLimitTuneAttempts = DEFAULT_LIMIT_TUNE_ATTEMPTS;
bool g_bShowNotRecording = DEFAULT_SHOW_NOT_RECORDING;
bool g_bPromptDeleteAtEnd = DEFAULT_PROMPT_DELETE;
bool g_bUseBackendBookmarks = DEFAULT_BACKEND_BOOKMARKS;
bool g_bRootDefaultGroup = DEFAULT_ROOT_DEFAULT_GROUP;

///* Client member variables */
ADDON_STATUS m_CurStatus = ADDON_STATUS_UNKNOWN;
Expand Down Expand Up @@ -353,6 +354,14 @@ ADDON_STATUS ADDON_Create(void *hdl, void *props)
g_bUseBackendBookmarks = DEFAULT_BACKEND_BOOKMARKS;
}

/* Read setting "root_default_group" from settings.xml */
if (!XBMC->GetSetting("root_default_group", &g_bRootDefaultGroup))
{
/* If setting is unknown fallback to defaults */
XBMC->Log(LOG_ERROR, "Couldn't get 'root_default_group' setting, falling back to '%u' as default", DEFAULT_ROOT_DEFAULT_GROUP);
g_bRootDefaultGroup = DEFAULT_ROOT_DEFAULT_GROUP;
}

free (buffer);
XBMC->Log(LOG_DEBUG, "Loading settings...done");

Expand Down Expand Up @@ -684,6 +693,15 @@ ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue)
PVR->TriggerRecordingUpdate();
}
}
else if (str == "root_default_group")
{
XBMC->Log(LOG_INFO, "Changed Setting 'root_default_group' from %u to %u", g_bRootDefaultGroup, *(bool*)settingValue);
if (g_bRootDefaultGroup != *(bool*)settingValue)
{
g_bRootDefaultGroup = *(bool*)settingValue;
PVR->TriggerRecordingUpdate();
}
}
return ADDON_STATUS_OK;
}

Expand Down
2 changes: 2 additions & 0 deletions src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
#define DEFAULT_PROMPT_DELETE false
#define DEFAULT_LIVETV_RECORDINGS true
#define DEFAULT_BACKEND_BOOKMARKS true
#define DEFAULT_ROOT_DEFAULT_GROUP false
/*!
* @brief PVR macros for string exchange
*/
Expand Down Expand Up @@ -119,6 +120,7 @@ extern bool g_bLimitTuneAttempts; ///< Limit channel tuning attemp
extern bool g_bShowNotRecording;
extern bool g_bPromptDeleteAtEnd;
extern bool g_bUseBackendBookmarks;
extern bool g_bRootDefaultGroup;

extern ADDON::CHelper_libXBMC_addon *XBMC;
extern CHelper_libXBMC_pvr *PVR;
Expand Down
4 changes: 3 additions & 1 deletion src/pvrclient-mythtv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,9 @@ PVR_ERROR PVRClientMythTV::GetRecordings(ADDON_HANDLE handle)
tag.iGenreType = genre&0xF0;

// Add recording title to directory to group everything according to its name just like MythTV does
std::string strDirectory(it->second.RecordingGroup());
std::string strDirectory;
if (!g_bRootDefaultGroup || it->second.RecordingGroup().compare("Default") != 0)
strDirectory.append(it->second.RecordingGroup());
if (g_iGroupRecordings == GROUP_RECORDINGS_ALWAYS || (g_iGroupRecordings == GROUP_RECORDINGS_ONLY_FOR_SERIES && it->second.GetPropsSerie()))
strDirectory.append("/").append(it->second.GroupingTitle());
PVR_STRCPY(tag.strDirectory, strDirectory.c_str());
Expand Down

0 comments on commit 86bca27

Please sign in to comment.