diff options
-rw-r--r-- | addons/resource.language.en_gb/resources/strings.po | 19 | ||||
-rwxr-xr-x | system/settings/settings.xml | 10 | ||||
-rw-r--r-- | xbmc/interfaces/builtins/LibraryBuiltins.cpp | 16 | ||||
-rw-r--r-- | xbmc/settings/Settings.cpp | 1 | ||||
-rw-r--r-- | xbmc/settings/Settings.h | 1 | ||||
-rw-r--r-- | xbmc/video/VideoDatabase.cpp | 97 | ||||
-rw-r--r-- | xbmc/video/VideoInfoScanner.cpp | 51 | ||||
-rw-r--r-- | xbmc/video/VideoInfoScanner.h | 6 | ||||
-rw-r--r-- | xbmc/video/dialogs/GUIDialogVideoInfo.cpp | 127 |
9 files changed, 248 insertions, 80 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index c573f6e5f9..fe7ae65899 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -12566,7 +12566,13 @@ msgctxt "#20225" msgid "Where no local album cover exists, online art will be used. Where neither is available, cover images embedded in music files will be used" msgstr "" -#empty strings from id 20226 to 20227 +#: system/settings/settings.xml +#: xbmc/music/dialogs/GUIDialogVideoInfo.cpp +msgctxt "#20226" +msgid "Movie set information folder" +msgstr "" + +#empty string id 20227 #: system/settings/settings.xml msgctxt "#20228" @@ -19155,7 +19161,16 @@ msgctxt "#36299" msgid "Switch display into HDR mode if media with HDR information is played.\nIf disabled, HDR information are applied using Kodi's internal HDR path." msgstr "" -#empty strings from id 36300 to 36301 +#. Description of setting with label #20226 "Movie set information folder" +#: system/settings/settings.xml +msgctxt "#36300" +msgid "Select the folder where movie set information (images) are saved locally." +msgstr "" + +#: xbmc/interfaces/builtins/LibraryBuiltins.cpp +msgctxt "#36301" +msgid "No 'Movie set information folder' is configured to store movie set images so they will not be exported. Do you want to proceed?" +msgstr "" #: system/settings/settings.xml msgctxt "#36302" diff --git a/system/settings/settings.xml b/system/settings/settings.xml index ec98e18efe..61e1394e28 100755 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -989,6 +989,16 @@ <default>true</default> <control type="toggle" /> </setting> + <setting id="videolibrary.moviesetsfolder" type="path" label="20226" help="36300"> + <level>1</level> + <default></default> + <constraints> + <allowempty>true</allowempty> + </constraints> + <control type="button" format="path"> + <heading>657</heading> + </control> + </setting> </group> </category> <category id="music" label="14216" help="38108"> diff --git a/xbmc/interfaces/builtins/LibraryBuiltins.cpp b/xbmc/interfaces/builtins/LibraryBuiltins.cpp index ed0008b47b..5a828c15d2 100644 --- a/xbmc/interfaces/builtins/LibraryBuiltins.cpp +++ b/xbmc/interfaces/builtins/LibraryBuiltins.cpp @@ -20,6 +20,8 @@ #include "messaging/helpers/DialogHelper.h" #include "music/MusicLibraryQueue.h" #include "settings/LibExportSettings.h" +#include "settings/Settings.h" +#include "settings/SettingsComponent.h" #include "storage/MediaManager.h" #include "utils/StringUtils.h" #include "utils/log.h" @@ -113,6 +115,20 @@ static int ExportLibrary(const std::vector<std::string>& params) if (cancelled) return -1; + if (thumbs && !singleFile && StringUtils::EqualsNoCase(params[0], "video")) + { + std::string movieSetsInfoPath = CServiceBroker::GetSettingsComponent()->GetSettings()-> + GetString(CSettings::SETTING_VIDEOLIBRARY_MOVIESETSFOLDER); + if (movieSetsInfoPath.empty()) + { + auto result = HELPERS::ShowYesNoDialogText(CVariant{iHeading}, CVariant{36301}); + cancelled = result != HELPERS::DialogResponse::YES; + } + } + + if (cancelled) + return -1; + if (thumbs && StringUtils::EqualsNoCase(params[0], "video")) { if (params.size() > 4) diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index 47db97b623..51f0c0f81c 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -114,6 +114,7 @@ const std::string CSettings::SETTING_VIDEOLIBRARY_CLEANUP = "videolibrary.cleanu const std::string CSettings::SETTING_VIDEOLIBRARY_EXPORT = "videolibrary.export"; const std::string CSettings::SETTING_VIDEOLIBRARY_IMPORT = "videolibrary.import"; const std::string CSettings::SETTING_VIDEOLIBRARY_SHOWEMPTYTVSHOWS = "videolibrary.showemptytvshows"; +const std::string CSettings::SETTING_VIDEOLIBRARY_MOVIESETSFOLDER = "videolibrary.moviesetsfolder"; const std::string CSettings::SETTING_LOCALE_AUDIOLANGUAGE = "locale.audiolanguage"; const std::string CSettings::SETTING_VIDEOPLAYER_PREFERDEFAULTFLAG = "videoplayer.preferdefaultflag"; const std::string CSettings::SETTING_VIDEOPLAYER_AUTOPLAYNEXTITEM = "videoplayer.autoplaynextitem"; diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index c57a104f48..46dfb1df0f 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -80,6 +80,7 @@ public: static const std::string SETTING_VIDEOLIBRARY_EXPORT; static const std::string SETTING_VIDEOLIBRARY_IMPORT; static const std::string SETTING_VIDEOLIBRARY_SHOWEMPTYTVSHOWS; + static const std::string SETTING_VIDEOLIBRARY_MOVIESETSFOLDER; static const std::string SETTING_LOCALE_AUDIOLANGUAGE; static const std::string SETTING_VIDEOPLAYER_PREFERDEFAULTFLAG; static const std::string SETTING_VIDEOPLAYER_AUTOPLAYNEXTITEM; diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 9b5cc01fb8..654f630e54 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -2441,13 +2441,11 @@ int CVideoDatabase::SetDetailsForMovie(const std::string& strFilenameAndPath, CV // add art if not available if (!HasArtForItem(idSet, MediaTypeVideoCollection)) { - std::map<std::string, std::string> setArt; for (const auto &it : artwork) { if (StringUtils::StartsWith(it.first, "set.")) - setArt[it.first.substr(4)] = it.second; + SetArtForItem(idSet, MediaTypeVideoCollection, it.first.substr(4), it.second); } - SetArtForItem(idSet, MediaTypeVideoCollection, setArt.empty() ? artwork : setArt); } } @@ -2559,9 +2557,6 @@ int CVideoDatabase::UpdateDetailsForMovie(int idMovie, CVideoInfoTag& details, c if (!details.m_set.title.empty()) { idSet = AddSet(details.m_set.title, details.m_set.overview); - // add art if not available - if (!HasArtForItem(idSet, MediaTypeVideoCollection)) - SetArtForItem(idSet, MediaTypeVideoCollection, artwork); } } @@ -4832,23 +4827,13 @@ std::vector<std::string> GetMovieSetAvailableArtTypes(int mediaId, CVideoDatabas { CVideoInfoTag* pTag = item->GetVideoInfoTag(); pTag->m_strPictureURL.Parse(); - //! @todo artwork: fanart stored separately, doesn't need to be - pTag->m_fanart.Unpack(); - if (pTag->m_fanart.GetNumFanarts() && - std::find(result.cbegin(), result.cend(), "fanart") == result.cend()) - { - result.emplace_back("fanart"); - } - // all other images for (const auto& urlEntry : pTag->m_strPictureURL.m_url) { - std::string artType = urlEntry.m_aspect; - if (artType.empty()) - artType = "poster"; - else if (StringUtils::StartsWith(artType, "set.")) - artType = artType.substr(4); + if (!StringUtils::StartsWith(urlEntry.m_aspect, "set.")) + continue; + std::string artType = urlEntry.m_aspect.substr(4); if (std::find(result.cbegin(), result.cend(), artType) == result.cend()) result.push_back(artType); } @@ -9462,6 +9447,7 @@ void CVideoDatabase::ExportToXML(const std::string &path, bool singleFile /* = t std::string xmlFile = URIUtils::AddFileToFolder(exportRoot, "videodb.xml"); std::string actorsDir = URIUtils::AddFileToFolder(exportRoot, "actors"); std::string moviesDir = URIUtils::AddFileToFolder(exportRoot, "movies"); + std::string movieSetsDir = URIUtils::AddFileToFolder(exportRoot, "moviesets"); std::string musicvideosDir = URIUtils::AddFileToFolder(exportRoot, "musicvideos"); std::string tvshowsDir = URIUtils::AddFileToFolder(exportRoot, "tvshows"); if (singleFile) @@ -9473,6 +9459,7 @@ void CVideoDatabase::ExportToXML(const std::string &path, bool singleFile /* = t CDirectory::Create(exportRoot); CDirectory::Create(actorsDir); CDirectory::Create(moviesDir); + CDirectory::Create(movieSetsDir); CDirectory::Create(musicvideosDir); CDirectory::Create(tvshowsDir); } @@ -9603,6 +9590,58 @@ void CVideoDatabase::ExportToXML(const std::string &path, bool singleFile /* = t } m_pDS->close(); + if (!singleFile) + movieSetsDir = CServiceBroker::GetSettingsComponent()->GetSettings()->GetString( + CSettings::SETTING_VIDEOLIBRARY_MOVIESETSFOLDER); + if (images && !movieSetsDir.empty()) + { + // find all movie sets + sql = "select idSet, strSet from sets"; + + m_pDS->query(sql); + + total = m_pDS->num_rows(); + current = 0; + + while (!m_pDS->eof()) + { + std::string title = m_pDS->fv("strSet").get_asString(); + + if (progress) + { + progress->SetLine(1, CVariant{title}); + progress->SetPercentage(current * 100 / total); + progress->Progress(); + if (progress->IsCanceled()) + { + progress->Close(); + m_pDS->close(); + return; + } + } + + std::string itemPath = URIUtils::AddFileToFolder(movieSetsDir, + CUtil::MakeLegalFileName(title, LEGAL_WIN32_COMPAT)); + if (CDirectory::Exists(itemPath) || CDirectory::Create(itemPath)) + { + std::map<std::string, std::string> artwork; + GetArtForItem(m_pDS->fv("idSet").get_asInt(), MediaTypeVideoCollection, artwork); + for (const auto& art : artwork) + { + std::string savedThumb = URIUtils::AddFileToFolder(itemPath, art.first); + CTextureCache::GetInstance().Export(art.second, savedThumb, overwrite); + } + } + else + CLog::Log(LOGDEBUG, + "CVideoDatabase::%s - Not exporting movie set '%s' as could not create folder '%s'", + __FUNCTION__, title.c_str(), itemPath.c_str()); + m_pDS->next(); + current++; + } + m_pDS->close(); + } + // find all musicvideos sql = "select * from musicvideo_view"; @@ -10015,6 +10054,7 @@ void CVideoDatabase::ImportFromXML(const std::string &path) std::string actorsDir(URIUtils::AddFileToFolder(path, "actors")); std::string moviesDir(URIUtils::AddFileToFolder(path, "movies")); + std::string movieSetsDir(URIUtils::AddFileToFolder(path, "moviesets")); std::string musicvideosDir(URIUtils::AddFileToFolder(path, "musicvideos")); std::string tvshowsDir(URIUtils::AddFileToFolder(path, "tvshows")); CVideoInfoScanner scanner; @@ -10062,6 +10102,25 @@ void CVideoDatabase::ImportFromXML(const std::string &path) artItem.SetPath(GetSafeFile(moviesDir, filename) + ".avi"); scanner.GetArtwork(&artItem, CONTENT_MOVIES, useFolders, true, actorsDir); item.SetArt(artItem.GetArt()); + if (!item.GetVideoInfoTag()->m_set.title.empty()) + { + std::string setPath = URIUtils::AddFileToFolder(movieSetsDir, + CUtil::MakeLegalFileName(item.GetVideoInfoTag()->m_set.title, LEGAL_WIN32_COMPAT)); + if (CDirectory::Exists(setPath)) + { + CGUIListItem::ArtMap setArt; + CFileItem artItem(setPath, true); + for (const auto& artType : CVideoThumbLoader::GetArtTypes(MediaTypeVideoCollection)) + { + std::string artPath = CVideoThumbLoader::GetLocalArt(artItem, artType, true); + if (!artPath.empty()) + { + setArt[artType] = artPath; + } + } + item.AppendArt(setArt, "set"); + } + } scanner.AddVideo(&item, CONTENT_MOVIES, useFolders, true, NULL, true); current++; } diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index ede85a45f3..ef6304ab0f 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -1432,6 +1432,52 @@ namespace VIDEO return type; } + std::string CVideoInfoScanner::GetMovieSetInfoFolder(const std::string& setTitle) + { + if (setTitle.empty()) + return ""; + std::string path = CServiceBroker::GetSettingsComponent()->GetSettings()->GetString( + CSettings::SETTING_VIDEOLIBRARY_MOVIESETSFOLDER); + if (path.empty()) + return ""; + path = URIUtils::AddFileToFolder(path, CUtil::MakeLegalFileName(setTitle, LEGAL_WIN32_COMPAT)); + CLog::Log(LOGDEBUG, + "VideoInfoScanner: Looking for local artwork for movie set '{}' in folder '{}'", + setTitle, + CURL::GetRedacted(path)); + return CDirectory::Exists(path) ? path : ""; + } + + void CVideoInfoScanner::GetLocalMovieSetArtwork(CGUIListItem::ArtMap& art, + const std::vector<std::string>& artTypes, const std::string& setTitle) + { + std::string path = GetMovieSetInfoFolder(setTitle); + if (path.empty()) + return; + + CFileItemList availableArtFiles; + CDirectory::GetDirectory(path, availableArtFiles, + CServiceBroker::GetFileExtensionProvider().GetPictureExtensions(), + DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_READ_CACHE | DIR_FLAG_NO_FILE_INFO); + + for (const auto& artFile : availableArtFiles) + { + std::string candidate = URIUtils::GetFileName(artFile->GetPath()); + URIUtils::RemoveExtension(candidate); + for (const auto& artType : artTypes) + { + if (!StringUtils::StartsWith(artType, "set.")) + continue; + std::string realType = artType.substr(4); + if (StringUtils::EqualsNoCase(candidate, realType)) + { + art[artType] = artFile->GetPath(); + break; + } + } + } + } + void CVideoInfoScanner::GetArtwork(CFileItem *pItem, const CONTENT_TYPE &content, bool bApplyToDir, bool useLocal, const std::string &actorArtPath) { CVideoInfoTag &movieDetails = *pItem->GetVideoInfoTag(); @@ -1444,7 +1490,8 @@ namespace VIDEO std::vector<std::string> artTypes = CVideoThumbLoader::GetArtTypes(ContentToMediaType(content, pItem->m_bIsFolder)); bool lookForThumb = find(artTypes.begin(), artTypes.end(), "thumb") == artTypes.end() && art.find("thumb") == art.end(); - if (content == CONTENT_MOVIES) + bool moviePartOfSet = content == CONTENT_MOVIES && !movieDetails.m_set.title.empty(); + if (moviePartOfSet) { for (std::string artType : CVideoThumbLoader::GetArtTypes(MediaTypeVideoCollection)) artTypes.push_back("set." + artType); @@ -1461,6 +1508,8 @@ namespace VIDEO art.insert(std::make_pair(*i, image)); } } + if (moviePartOfSet) + GetLocalMovieSetArtwork(art, artTypes, movieDetails.m_set.title); // find and classify the local thumb (backcompat) if available if (lookForThumb) { diff --git a/xbmc/video/VideoInfoScanner.h b/xbmc/video/VideoInfoScanner.h index 556afa269d..2d9966124d 100644 --- a/xbmc/video/VideoInfoScanner.h +++ b/xbmc/video/VideoInfoScanner.h @@ -101,6 +101,8 @@ namespace VIDEO bool EnumerateEpisodeItem(const CFileItem *item, EPISODELIST& episodeList); + static std::string GetMovieSetInfoFolder(const std::string& setTitle); + protected: virtual void Process(); bool DoScan(const std::string& strDirectory) override; @@ -231,6 +233,10 @@ namespace VIDEO CVideoDatabase m_database; std::set<std::string> m_pathsToCount; std::set<int> m_pathsToClean; + + private: + void GetLocalMovieSetArtwork(CGUIListItem::ArtMap& art, + const std::vector<std::string>& artTypes, const std::string& setTitle); }; } diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp index 62ffd46c3c..50344aa504 100644 --- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp @@ -41,6 +41,7 @@ #include "settings/SettingsComponent.h" #include "settings/lib/Setting.h" #include "storage/MediaManager.h" +#include "utils/FileExtensionProvider.h" #include "utils/FileUtils.h" #include "utils/SortUtils.h" #include "utils/StringUtils.h" @@ -1118,13 +1119,14 @@ std::string CGUIDialogVideoInfo::GetThumbnail() const return m_movieItem->GetArt("thumb"); } -void CGUIDialogVideoInfo::AddItemPathToFileBrowserSources(VECSOURCES &sources, const CFileItem &item) +namespace +{ +std::string GetItemPathForBrowserSource(const CFileItem& item) { if (!item.HasVideoInfoTag()) - return; + return ""; std::string itemDir = item.GetVideoInfoTag()->m_basePath; - //season if (itemDir.empty()) itemDir = item.GetVideoInfoTag()->GetPath(); @@ -1133,14 +1135,28 @@ void CGUIDialogVideoInfo::AddItemPathToFileBrowserSources(VECSOURCES &sources, c if (itemTmp.IsVideo()) itemDir = URIUtils::GetParentPath(itemDir); + return itemDir; +} + +void AddItemPathStringToFileBrowserSources(VECSOURCES& sources, + const std::string& itemDir, const std::string& label) +{ if (!itemDir.empty() && CDirectory::Exists(itemDir)) { CMediaSource itemSource; - itemSource.strName = g_localizeStrings.Get(36041); + itemSource.strName = label; itemSource.strPath = itemDir; sources.push_back(itemSource); } } +} // namespace + +void CGUIDialogVideoInfo::AddItemPathToFileBrowserSources(VECSOURCES& sources, + const CFileItem& item) +{ + std::string itemDir = GetItemPathForBrowserSource(item); + AddItemPathStringToFileBrowserSources(sources, itemDir, g_localizeStrings.Get(36041)); +} int CGUIDialogVideoInfo::ManageVideoItem(const CFileItemPtr &item) { @@ -1840,6 +1856,29 @@ bool CGUIDialogVideoInfo::RemoveItemsFromTag(const CFileItemPtr &tagItem) return true; } +namespace +{ +std::string FindLocalMovieSetArtworkFile(const CFileItemPtr& item, const std::string& artType) +{ + std::string infoFolder = VIDEO::CVideoInfoScanner::GetMovieSetInfoFolder(item->GetLabel()); + if (infoFolder.empty()) + return ""; + + CFileItemList availableArtFiles; + CDirectory::GetDirectory(infoFolder, availableArtFiles, + CServiceBroker::GetFileExtensionProvider().GetPictureExtensions(), + DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_READ_CACHE | DIR_FLAG_NO_FILE_INFO); + for (const auto& artFile : availableArtFiles) + { + std::string candidate = URIUtils::GetFileName(artFile->GetPath()); + URIUtils::RemoveExtension(candidate); + if (StringUtils::EqualsNoCase(candidate, artType)) + return artFile->GetPath(); + } + return ""; +} +} // namespace + bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const MediaType &type) { if (item == nullptr || !item->HasVideoInfoTag() || type.empty()) @@ -1885,7 +1924,7 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const if (artType.empty()) return false; - if (artType == "fanart") + if (artType == "fanart" && type != MediaTypeVideoCollection) return OnGetFanart(item); if (item->HasArt(artType)) @@ -1920,15 +1959,12 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const std::string baseDir = StringUtils::Format("videodb://movies/sets/%d", item->GetVideoInfoTag()->m_iDbId); if (videodb.GetMoviesNav(baseDir, items)) { - std::vector<std::string> allMovieThumbs; for (int i=0; i < items.Size(); i++) { CVideoInfoTag* pTag = items[i]->GetVideoInfoTag(); pTag->m_strPictureURL.Parse(); - pTag->m_strPictureURL.GetThumbURLs(allMovieThumbs, artType); pTag->m_strPictureURL.GetThumbURLs(thumbs, "set." + artType, -1, true); } - std::copy(allMovieThumbs.begin(), allMovieThumbs.end(), std::back_inserter(thumbs)); } } else @@ -1966,7 +2002,19 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const } if (type == MediaTypeVideoCollection) - noneitem->SetArt("icon", "DefaultVideo.png"); + { + std::string localFile = FindLocalMovieSetArtworkFile(item, artType); + if (!localFile.empty()) + { + CFileItemPtr pItem(new CFileItem(localFile, false)); + pItem->SetLabel(g_localizeStrings.Get(13514)); + pItem->SetArt("thumb", localFile); + items.Add(pItem); + local = true; + } + else + noneitem->SetArt("icon", "DefaultVideo.png"); + } } else { @@ -2003,7 +2051,18 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const std::string result; VECSOURCES sources=*CMediaSourceSettings::GetInstance().GetSources("video"); CServiceBroker::GetMediaManager().GetLocalDrives(sources); - AddItemPathToFileBrowserSources(sources, *item); + if (type == MediaTypeVideoCollection) + { + AddItemPathStringToFileBrowserSources(sources, + VIDEO::CVideoInfoScanner::GetMovieSetInfoFolder(item->GetLabel()), + g_localizeStrings.Get(36041)); + AddItemPathStringToFileBrowserSources(sources, + CServiceBroker::GetSettingsComponent()->GetSettings()->GetString( + CSettings::SETTING_VIDEOLIBRARY_MOVIESETSFOLDER), + "* " + g_localizeStrings.Get(20226)); + } + else + AddItemPathToFileBrowserSources(sources, *item); if (!CGUIDialogFileBrowser::ShowAndGetImage(items, sources, g_localizeStrings.Get(13511), result)) return false; // user cancelled @@ -2177,49 +2236,6 @@ bool CGUIDialogVideoInfo::OnGetFanart(const CFileItemPtr &videoItem) items.Add(itemCurrent); } - std::vector<std::string> thumbs; - if (videoItem->GetVideoInfoTag()->m_type == MediaTypeVideoCollection) - { - CFileItemList movies; - std::string baseDir = StringUtils::Format("videodb://movies/sets/%d", videoItem->GetVideoInfoTag()->m_iDbId); - if (videodb.GetMoviesNav(baseDir, movies)) - { - int iFanart = 0; - for (int i=0; i < movies.Size(); i++) - { - movies[i]->GetVideoInfoTag()->m_strPictureURL.Parse(); - movies[i]->GetVideoInfoTag()->m_strPictureURL.GetThumbURLs(thumbs, "set.fanart", -1, true); - } - for (auto &fanart : thumbs) - { - CFileItemPtr item(new CFileItem(StringUtils::Format("fanart://Remote{0}", iFanart++), false)); - item->SetArt("thumb", fanart); - item->SetArt("icon", "DefaultPicture.png"); - item->SetLabel(g_localizeStrings.Get(20441)); // "Remote fanart" - items.Add(item); - } - for (int i=0; i < movies.Size(); i++) - { - // ensure the fanart is unpacked - movies[i]->GetVideoInfoTag()->m_fanart.Unpack(); - - // Grab the thumbnails from the web - for (unsigned int j = 0; j < movies[i]->GetVideoInfoTag()->m_fanart.GetNumFanarts(); j++) - { - std::string strItemPath = StringUtils::Format("fanart://Remote%i",iFanart++); - CFileItemPtr item(new CFileItem(strItemPath, false)); - std::string thumb = movies[i]->GetVideoInfoTag()->m_fanart.GetPreviewURL(j); - item->SetArt("thumb", CTextureUtils::GetWrappedThumbURL(thumb)); - item->SetArt("icon", "DefaultPicture.png"); - item->SetLabel(g_localizeStrings.Get(20441)); - thumbs.push_back(movies[i]->GetVideoInfoTag()->m_fanart.GetImageURL(j)); - - items.Add(item); - } - } - } - } - // add the none option { CFileItemPtr itemNone(new CFileItem("fanart://None", false)); @@ -2237,11 +2253,6 @@ bool CGUIDialogVideoInfo::OnGetFanart(const CFileItemPtr &videoItem) StringUtils::EqualsNoCase(result, "fanart://Current")) return false; - if (StringUtils::StartsWith(result, "fanart://Remote")) - { - int iFanart = atoi(result.substr(15).c_str()); - result = thumbs[iFanart]; - } else if (StringUtils::EqualsNoCase(result, "fanart://None") || !CFile::Exists(result)) result.clear(); if (!result.empty() && flip) |