Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1922 from ace20022/browse_for_art_music

[art] Add the album/song path to the get thumb "browse for art" dialog
  • Loading branch information...
commit f8bdd1bbd25cf8869671ffe3d42175b0bc708447 2 parents fbfe5ee + 3389c1d
@MartijnKaijser MartijnKaijser authored
View
19 xbmc/music/dialogs/GUIDialogMusicInfo.cpp
@@ -40,6 +40,7 @@
#include "utils/StringUtils.h"
#include "TextureCache.h"
#include "music/MusicThumbLoader.h"
+#include "filesystem/Directory.h"
using namespace std;
using namespace XFILE;
@@ -416,6 +417,7 @@ void CGUIDialogMusicInfo::OnGetThumb()
CStdString result;
bool flip=false;
VECSOURCES sources(g_settings.m_musicSources);
+ AddItemPathToFileBrowserSources(sources, *m_albumItem);
g_mediaManager.GetLocalDrives(sources);
if (!CGUIDialogFileBrowser::ShowAndGetImage(items, sources, g_localizeStrings.Get(1030), result, &flip))
return; // user cancelled
@@ -578,3 +580,20 @@ CFileItemPtr CGUIDialogMusicInfo::GetCurrentListItem(int offset)
return m_albumItem;
}
+void CGUIDialogMusicInfo::AddItemPathToFileBrowserSources(VECSOURCES &sources, const CFileItem &item)
+{
+ CStdString itemDir;
+
+ if (item.HasMusicInfoTag() && item.GetMusicInfoTag()->GetType() == "song")
+ itemDir = URIUtils::GetParentPath(item.GetMusicInfoTag()->GetURL());
+ else
+ itemDir = item.GetPath();
+
+ if (!itemDir.IsEmpty() && CDirectory::Exists(itemDir))
+ {
+ CMediaSource itemSource;
+ itemSource.strName = g_localizeStrings.Get(36041);
+ itemSource.strPath = itemDir;
+ sources.push_back(itemSource);
+ }
+}
View
2  xbmc/music/dialogs/GUIDialogMusicInfo.h
@@ -24,6 +24,7 @@
#include "music/Song.h"
#include "music/Artist.h"
#include "music/Album.h"
+#include "FileItem.h"
class CFileItem;
class CFileItemList;
@@ -44,6 +45,7 @@ class CGUIDialogMusicInfo :
virtual bool HasListItems() const { return true; };
virtual CFileItemPtr GetCurrentListItem(int offset = 0);
const CFileItemList& CurrentDirectory() const { return *m_albumSongs; };
+ static void AddItemPathToFileBrowserSources(VECSOURCES &sources, const CFileItem &item);
protected:
virtual void OnInitWindow();
void Update();
View
7 xbmc/music/dialogs/GUIDialogSongInfo.cpp
@@ -37,6 +37,8 @@
#include "guilib/LocalizeStrings.h"
#include "TextureCache.h"
#include "music/Album.h"
+#include "storage/MediaManager.h"
+#include "GUIDialogMusicInfo.h"
using namespace XFILE;
@@ -286,7 +288,10 @@ void CGUIDialogSongInfo::OnGetThumb()
}
CStdString result;
- if (!CGUIDialogFileBrowser::ShowAndGetImage(items, g_settings.m_musicSources, g_localizeStrings.Get(1030), result))
+ VECSOURCES sources(g_settings.m_musicSources);
+ CGUIDialogMusicInfo::AddItemPathToFileBrowserSources(sources, *m_song);
+ g_mediaManager.GetLocalDrives(sources);
+ if (!CGUIDialogFileBrowser::ShowAndGetImage(items, sources, g_localizeStrings.Get(1030), result))
return; // user cancelled
if (result == "thumb://Current")
Please sign in to comment.
Something went wrong with that request. Please try again.