From 72a5b2ce2facc4ca28114acc72c4a6c570a120a5 Mon Sep 17 00:00:00 2001 From: DaveTBlake Date: Thu, 21 Mar 2019 13:45:36 +0000 Subject: On refresh of album or artist from info dialog, prompt to ignore NFO file and fetch metadata and art from remote sites --- addons/resource.language.en_gb/resources/strings.po | 5 +++++ xbmc/music/infoscanner/MusicInfoScanner.cpp | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index ebaa166c03..24057b98fd 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -5338,6 +5338,7 @@ msgid "Now playing - Videos" msgstr "" #: xbmc/music/ContextMenus.h +#: xbmc/music/infoscanner/MusicInfoScanner.cpp msgctxt "#10523" msgid "Album information" msgstr "" @@ -13258,6 +13259,9 @@ msgctxt "#20445" msgid "Fanart" msgstr "" +#. Ask user when refreshing music or video info if they want to use data from NFO file +#: xbmc/music/infoscanner/MusicInfoScanner.cpp +#: xbmc/video/jobs/VideoLibraryRefreshingJob.cpp msgctxt "#20446" msgid "Locally stored information found. Ignore and refresh from Internet?" msgstr "" @@ -14390,6 +14394,7 @@ msgid "Select artist" msgstr "" #: xbmc/music/dialogs/GUIDialogMusicInfo.cpp +#: xbmc/music/infoscanner/MusicInfoScanner.cpp #: xbmc/music/ContextMenus.h msgctxt "#21891" msgid "Artist information" diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp index 0082f0dc91..250becbdac 100644 --- a/xbmc/music/infoscanner/MusicInfoScanner.cpp +++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp @@ -18,6 +18,7 @@ #include "dialogs/GUIDialogExtendedProgressBar.h" #include "dialogs/GUIDialogProgress.h" #include "dialogs/GUIDialogSelect.h" +#include "dialogs/GUIDialogYesNo.h" #include "events/EventLog.h" #include "events/MediaLibraryEvent.h" #include "FileItem.h" @@ -1439,6 +1440,7 @@ CMusicInfoScanner::DownloadAlbumInfo(const CAlbum& album, } // handle nfo files + bool existsNFO = false; std::string path = album.strPath; if (path.empty()) m_musicDatabase.GetAlbumPath(album.idAlbum, path); @@ -1446,7 +1448,14 @@ CMusicInfoScanner::DownloadAlbumInfo(const CAlbum& album, std::string strNfo = URIUtils::AddFileToFolder(path, "album.nfo"); CInfoScanner::INFO_TYPE result = CInfoScanner::NO_NFO; CNfoFile nfoReader; - if (XFILE::CFile::Exists(strNfo)) + existsNFO = XFILE::CFile::Exists(strNfo); + // When on GUI ask user if they want to ignore nfo and refresh from Internet + if (existsNFO && pDialog && CGUIDialogYesNo::ShowAndGetInput(10523, 20446)) + { + existsNFO = false; + CLog::Log(LOGDEBUG, "Ignoring nfo file: %s", CURL::GetRedacted(strNfo).c_str()); + } + if (existsNFO) { CLog::Log(LOGDEBUG,"Found matching nfo file: %s", CURL::GetRedacted(strNfo).c_str()); result = nfoReader.Create(strNfo, info); @@ -1727,6 +1736,13 @@ CMusicInfoScanner::DownloadArtistInfo(const CArtist& artist, CLog::Log(LOGDEBUG, "%s not have path, nfo file not possible", artist.strArtist.c_str()); } + // When on GUI ask user if they want to ignore nfo and refresh from Internet + if (existsNFO && pDialog && CGUIDialogYesNo::ShowAndGetInput(21891, 20446)) + { + existsNFO = false; + CLog::Log(LOGDEBUG, "Ignoring nfo file: %s", CURL::GetRedacted(strNfo).c_str()); + } + if (existsNFO) { CLog::Log(LOGDEBUG, "Found matching nfo file: %s", CURL::GetRedacted(strNfo).c_str()); -- cgit v1.2.3