Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preparation of new skins #47

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions system/library/music/albums_services.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="3" type="folder" visible="!Library.HasContent(Music) + Library.HasServices">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Library.HasServices has been made redundant from 3.7.0, Library.HasContent(xxxx) will take care of plex and emby music (or tvshow/movies) content as well

Copy link
Collaborator

@amet amet May 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Library.HasServices will always return false from now on... not sure if that ruins any of your plans in this commit :(

if it does, let me know and we can work out some way to accommodate it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcelveldt

I think ^^ is causing the issues in 3.7.0 testflight... Library.HasServices is no more, and Library.HasContent(xxx) will return if Plex and Emby services exist.

I dont get anything for inProgress movies when only local database is enabled and no plex/emby data base available.

<label>132</label>
<icon>DefaultMusicAlbums.png</icon>
<path>services://music/albums</path>
<content>albums</content>
</node>
7 changes: 7 additions & 0 deletions system/library/music/artists_services.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="2" type="folder" visible="!Library.HasContent(Music) + Library.HasServices">
<label>133</label>
<icon>DefaultMusicArtists.png</icon>
<content>artists</content>
<path>services://music/artists/</path>
</node>
4 changes: 2 additions & 2 deletions system/library/music/recentlyaddedalbums.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="8" type="folder" visible="Library.HasContent(Music)">
<node order="8" type="folder" visible="Library.HasContent(Music) | Library.HasServices">
<label>359</label>
<icon>DefaultMusicRecentlyAdded.png</icon>
<path>musicdb://recentlyaddedalbums/</path>
<path>services://music/recentlyaddedalbums/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/music/songs_services.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="5" type="folder" visible="!Library.HasContent(Music) + Library.HasServices">
<label>134</label>
<icon>DefaultMusicSongs.png</icon>
<content>songs</content>
<path>services://music/songs/</path>
</node>
4 changes: 2 additions & 2 deletions system/library/video/inprogressmovies.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="4" type="filter" visible="Library.HasContent(Movies)">
<node order="4" type="folder" visible="Library.HasContent(Movies) | Library.HasServices">
<label>627</label>
<icon>DefaultInProgressShows.png</icon>
<content>movies</content>
<rule field="inprogress" operator="true" />
<path>services://movies/inprogressmovies</path>
</node>
4 changes: 2 additions & 2 deletions system/library/video/inprogressshows.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="4" type="filter" visible="Library.HasContent(TVShows)">
<node order="4" type="folder" visible="Library.HasContent(TVShows) | Library.HasServices">
<label>626</label>
<icon>DefaultInProgressShows.png</icon>
<content>tvshows</content>
<rule field="inprogress" operator="true" />
<path>services://tvshows/inprogressshows/</path>
</node>
8 changes: 8 additions & 0 deletions system/library/video/movies_services/actors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="4" type="folder">
<label>344</label>
<icon>DefaultActor.png</icon>
<content>movies</content>
<path>services://movies/actors/</path>
</node>

7 changes: 7 additions & 0 deletions system/library/video/movies_services/country.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="8" type="folder">
<label>20451</label>
<icon>DefaultCountry.png</icon>
<content>movies</content>
<path>services://movies/countries/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/video/movies_services/directors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="5" type="folder">
<label>20348</label>
<icon>DefaultDirector.png</icon>
<content>movies</content>
<path>services://movies/directors/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/video/movies_services/genres.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="1" type="folder">
<label>135</label>
<icon>DefaultGenre.png</icon>
<content>movies</content>
<path>services://movies/genres/</path>
</node>
6 changes: 6 additions & 0 deletions system/library/video/movies_services/index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="1" visible="!Library.HasContent(Movies) + Library.HasServices">
<!-- a virtual folder -->
<label>342</label>
<icon>DefaultMovies.png</icon>
</node>
7 changes: 7 additions & 0 deletions system/library/video/movies_services/sets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="7" type="folder" visible="Library.HasServices">
<label>20434</label>
<icon>DefaultSets.png</icon>
<content>movies</content>
<path>services://movies/sets/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/video/movies_services/studios.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="6" type="folder">
<label>20388</label>
<icon>DefaultStudios.png</icon>
<content>movies</content>
<path>services://movies/studios/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/video/movies_services/tags.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="9" type="folder">
<label>20459</label>
<icon>DefaultTags.png</icon>
<content>movies</content>
<path>services://movies/tags/</path>
</node>
8 changes: 8 additions & 0 deletions system/library/video/movies_services/titles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="2" type="folder">
<label>369</label>
<icon>DefaultMovieTitle.png</icon>
<content>movies</content>
<order direction="ascending">sorttitle</order>
<path>services://movies/titles/</path>
</node>
8 changes: 8 additions & 0 deletions system/library/video/movies_services/years.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="3" type="folder">
<label>562</label>
<icon>DefaultYear.png</icon>
<content>movies</content>
<path>services://movies/years/</path>
</node>

4 changes: 2 additions & 2 deletions system/library/video/recentlyaddedepisodes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="11" type="folder" visible="Library.HasContent(TVShows)">
<node order="11" type="folder" visible="Library.HasContent(TVShows) | Library.HasServices">
<label>20387</label>
<icon>DefaultRecentlyAddedEpisodes.png</icon>
<path>videodb://recentlyaddedepisodes/</path>
<path>services://tvshows/recentlyaddedepisodes/</path>
</node>
4 changes: 2 additions & 2 deletions system/library/video/recentlyaddedmovies.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="10" type="folder" visible="Library.HasContent(Movies)">
<node order="10" type="folder" visible="Library.HasContent(Movies) | Library.HasServices">
<label>20386</label>
<icon>DefaultRecentlyAddedMovies.png</icon>
<path>videodb://recentlyaddedmovies/</path>
<path>services://movies/recentlyaddedmovies/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/video/tvshows_services/actors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="4" type="folder">
<label>344</label>
<icon>DefaultActor.png</icon>
<content>tvshows</content>
<path>services://tvshows/actors/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/video/tvshows_services/genres.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="1" type="folder">
<label>135</label>
<icon>DefaultGenre.png</icon>
<content>tvshows</content>
<path>services://tvshows/genres/</path>
</node>
5 changes: 5 additions & 0 deletions system/library/video/tvshows_services/index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="2" visible="!Library.HasContent(TVShows) + Library.HasServices">
<label>20343</label>
<icon>DefaultTVShows.png</icon>
</node>
7 changes: 7 additions & 0 deletions system/library/video/tvshows_services/studios.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="5" type="folder">
<label>20388</label>
<icon>DefaultStudios.png</icon>
<content>tvshows</content>
<path>services://tvshows/studios/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/video/tvshows_services/tags.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="6" type="folder">
<label>20459</label>
<icon>DefaultTags.png</icon>
<content>tvshows</content>
<path>services://tvshows/tags/</path>
</node>
8 changes: 8 additions & 0 deletions system/library/video/tvshows_services/titles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="2" type="folder">
<label>369</label>
<icon>DefaultTVShowTitle.png</icon>
<content>tvshows</content>
<path>services://tvshows/titles/</path>
<order direction="ascending">sorttitle</order>
</node>
7 changes: 7 additions & 0 deletions system/library/video/tvshows_services/years.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="3" type="folder">
<label>562</label>
<icon>DefaultYear.png</icon>
<content>tvshows</content>
<path>services://tvshows/years/</path>
</node>
7 changes: 7 additions & 0 deletions system/library/video_flat/inprogressmovies.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="4" type="folder" visible="Library.HasContent(Movies) | Library.HasServices">
<label>627</label>
<icon>DefaultInProgressShows.png</icon>
<content>movies</content>
<path>services://movies/inprogressmovies</path>
</node>
4 changes: 2 additions & 2 deletions system/library/video_flat/inprogressshows.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="4" type="filter" visible="Library.HasContent(TVShows)">
<node order="4" type="folder" visible="Library.HasContent(TVShows) | Library.HasServices">
<label>626</label>
<icon>DefaultInProgressShows.png</icon>
<content>tvshows</content>
<rule field="inprogress" operator="true" />
<path>services://tvshows/inprogressshows/</path>
</node>
3 changes: 2 additions & 1 deletion system/library/video_flat/movies.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="1" type="filter" visible="Library.HasContent(Movies)">
<node order="1" type="folder" visible="Library.HasContent(Movies) | Library.HasServices">
<label>342</label>
<icon>DefaultMovies.png</icon>
<content>movies</content>
<order direction="ascending">sorttitle</order>
<path>services://movies/titles/</path>
</node>
4 changes: 2 additions & 2 deletions system/library/video_flat/recentlyaddedepisodes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="11" type="folder" visible="Library.HasContent(TVShows)">
<node order="11" type="folder" visible="Library.HasContent(TVShows) | Library.HasServices">
<label>20387</label>
<icon>DefaultRecentlyAddedEpisodes.png</icon>
<path>videodb://recentlyaddedepisodes/</path>
<path>services://tvshows/recentlyaddedepisodes/</path>
</node>
4 changes: 2 additions & 2 deletions system/library/video_flat/recentlyaddedmovies.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="10" type="folder" visible="Library.HasContent(Movies)">
<node order="10" type="folder" visible="Library.HasContent(Movies) | Library.HasServices">
<label>20386</label>
<icon>DefaultRecentlyAddedMovies.png</icon>
<path>videodb://recentlyaddedmovies/</path>
<path>services://movies/recentlyaddedmovies/</path>
</node>
3 changes: 2 additions & 1 deletion system/library/video_flat/tvshows.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="2" type="filter" visible="Library.HasContent(TVShows)">
<node order="2" type="folder" visible="Library.HasContent(TVShows) | Library.HasServices">
<label>20343</label>
<icon>DefaultTVShows.png</icon>
<content>tvshows</content>
<order direction="ascending">sorttitle</order>
<path>services://movies/titles/</path>
</node>
5 changes: 5 additions & 0 deletions xbmc/FileItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,11 @@ bool CFileItem::IsVirtualDirectoryRoot() const
return (m_bIsFolder && m_strPath.empty());
}

bool CFileItem::IsFolder() const
{
return m_bIsFolder;
}

bool CFileItem::IsRemovable() const
{
return IsOnDVD() || IsCDDA() || m_iDriveType == CMediaSource::SOURCE_TYPE_REMOVABLE;
Expand Down
1 change: 1 addition & 0 deletions xbmc/FileItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ class CFileItem :
bool IsPVRRadioRDS() const;
bool IsType(const char *ext) const;
bool IsVirtualDirectoryRoot() const;
bool IsFolder() const;
bool IsReadOnly() const;
bool CanQueue() const;
void SetCanQueue(bool bYesNo);
Expand Down
6 changes: 6 additions & 0 deletions xbmc/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,12 @@ int CUtil::GetMatchingSource(const std::string& strPath1, VECSOURCES& VECSOURCES
strPath = checkURL.GetHostName();
if (checkURL.IsProtocol("plugin"))
return 1;
if (checkURL.IsProtocol("services"))
return 1;
if (checkURL.IsProtocol("plex"))
return 1;
if (checkURL.IsProtocol("emby"))
return 1;
if (checkURL.IsProtocol("multipath"))
strPath = CMultiPathDirectory::GetFirstPath(strPath);

Expand Down
4 changes: 3 additions & 1 deletion xbmc/addons/AddonManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,14 @@ static constexpr const char* addonWhiteList[] = {
"screensaver.xbmc.builtin.system",
"script.module.requests",
"script.plex",
"script.skinshortcuts",
"skin.amber",
"skin.blackglassnova",
"skin.mrmc",
"skin.opacity",
"skin.pm3.hd",
"skin.pm3-hd",
"skin.sio2",
"skin.titan",
"visualization.spectrum",
"visualization.waveform",
"webinterface.default",
Expand Down
14 changes: 14 additions & 0 deletions xbmc/addons/Skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,19 @@ void CSkinInfo::Start()
m_currentAspect = res.strId;
}
}

std::string CSkinInfo::GetSkinIncludeFile(const std::string& strFile) const
{
// try to load include from alternate location (support for skinshortcuts etc.)
std::string strPathAlt = URIUtils::AddFileToFolder(Profile(), strFile);
if (CFile::Exists(strPathAlt))
{
CLog::Log(LOGDEBUG, "Loading skin include from non-default location: %s", strPathAlt.c_str());
return strPathAlt;
}
else
return GetSkinPath(strFile);
}

std::string CSkinInfo::GetSkinPath(const std::string& strFile, RESOLUTION_INFO *res, const std::string& strBaseDir /* = "" */) const
{
Expand Down Expand Up @@ -264,6 +277,7 @@ std::string CSkinInfo::GetSkinPath(const std::string& strFile, RESOLUTION_INFO *

strPath = URIUtils::AddFileToFolder(strPathToUse, res->strMode);
strPath = URIUtils::AddFileToFolder(strPath, strFile);

return strPath;
}

Expand Down
7 changes: 7 additions & 0 deletions xbmc/addons/Skin.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ class CSkinInfo : public CAddon
void Start();

bool HasSkinFile(const std::string &strFile) const;

/*! \brief Get the full path for the specified file in the skin's include definition.
Try custom path first (for compatability with scripts like skinshortcuts etc.)
\param file XML file to look for
\return path to the XML file
*/
std::string GetSkinIncludeFile(const std::string& strFile) const;

/*! \brief Get the full path to the specified file in the skin
We search for XML files in the skin folder that best matches the current resolution.
Expand Down
2 changes: 2 additions & 0 deletions xbmc/filesystem/FavouritesDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ std::string CFavouritesDirectory::GetExecutePath(const CFileItem &item, const st
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else if (item.IsMediaServiceBased() && item.HasVideoInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetVideoInfoTag()->m_strFileNameAndPath).c_str());
else if (item.IsMusicDb() && item.HasMusicInfoTag())
execute = StringUtils::Format("PlayMedia(%s)", StringUtils::Paramify(item.GetMusicInfoTag()->GetURL()).c_str());
else if (item.IsPicture())
Expand Down
Loading