mirror of
https://github.com/libretro/Play-.git
synced 2025-02-08 18:16:12 +00:00
Moved title attribution logic from PlaylistDiscoveryService to Playlist to make the titles consistent.
git-svn-id: http://svn.purei.org/purei/trunk@1307 b36208d7-6611-0410-8bec-b1987f11c4a2
This commit is contained in:
parent
d6b21dd67e
commit
0af6278a45
@ -80,8 +80,15 @@ bool CPlaylist::IsLoadableExtension(const std::string& extension)
|
||||
|
||||
void CPlaylist::PopulateItemFromTags(ITEM& item, const CPsfTags& tags)
|
||||
{
|
||||
item.title = tags.GetTagValue("title");
|
||||
item.length = CPsfTags::ConvertTimeString(tags.GetTagValue("length").c_str());
|
||||
if(tags.HasTag("title"))
|
||||
{
|
||||
item.title = tags.GetTagValue("title");
|
||||
}
|
||||
else
|
||||
{
|
||||
item.title = item.path;
|
||||
}
|
||||
item.length = CPsfTags::ConvertTimeString(tags.GetTagValue("length").c_str());
|
||||
}
|
||||
|
||||
unsigned int CPlaylist::InsertArchive(const std::wstring& path)
|
||||
|
@ -66,8 +66,7 @@ void CPlaylistDiscoveryService::ProcessPendingItems(CPlaylist& playlist)
|
||||
if(itemIdx != -1)
|
||||
{
|
||||
CPlaylist::ITEM item = playlist.GetItem(itemIdx);
|
||||
item.title = result.title;
|
||||
item.length = result.length;
|
||||
CPlaylist::PopulateItemFromTags(item, result.tags);
|
||||
playlist.UpdateItem(itemIdx, item);
|
||||
}
|
||||
}
|
||||
@ -95,22 +94,7 @@ void CPlaylistDiscoveryService::ThreadProc()
|
||||
RESULT result;
|
||||
result.runId = command.runId;
|
||||
result.itemId = command.itemId;
|
||||
result.length = 0;
|
||||
|
||||
if(tags.HasTag("title"))
|
||||
{
|
||||
result.title = tags.GetTagValue("title");
|
||||
}
|
||||
else
|
||||
{
|
||||
result.title = command.filePath.GetWidePath();
|
||||
}
|
||||
|
||||
if(tags.HasTag("length"))
|
||||
{
|
||||
result.length = tags.ConvertTimeString(tags.GetTagValue("length").c_str());
|
||||
}
|
||||
|
||||
result.tags = tags;
|
||||
pendingResults.push_back(result);
|
||||
}
|
||||
catch(...)
|
||||
|
@ -33,8 +33,7 @@ private:
|
||||
{
|
||||
unsigned int runId;
|
||||
unsigned int itemId;
|
||||
std::wstring title;
|
||||
double length;
|
||||
CPsfTags tags;
|
||||
};
|
||||
|
||||
typedef std::deque<COMMAND> CommandQueue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user