aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Marshall <jmarshall@never.you.mind>2011-03-26 19:09:43 +1300
committerJonathan Marshall <jmarshall@never.you.mind>2011-03-26 19:11:01 +1300
commit6fc60315646d0b9db3f1d3847fcf89384aeca74c (patch)
tree64754c3ee4c0678843ffe59c5cf71734e36c8216
parentfca7b6634de19cab40244ad000bc7d46fd49d9ad (diff)
add listitem.discnumber infolabel
-rw-r--r--xbmc/GUIInfoManager.cpp18
-rw-r--r--xbmc/GUIInfoManager.h1
2 files changed, 10 insertions, 9 deletions
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 6e99cf20fa..ca4f1eee09 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -952,6 +952,7 @@ int CGUIInfoManager::TranslateListItem(const CStdString &info)
else if (info.Equals("originaltitle")) return LISTITEM_ORIGINALTITLE;
else if (info.Equals("lastplayed")) return LISTITEM_LASTPLAYED;
else if (info.Equals("playcount")) return LISTITEM_PLAYCOUNT;
+ else if (info.Equals("discnumber")) return LISTITEM_DISC_NUMBER;
else if (info.Left(9).Equals("property(")) return AddListItemProp(info.Mid(9, info.GetLength() - 10));
return 0;
}
@@ -3065,15 +3066,7 @@ CStdString CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item) co
}
break;
case MUSICPLAYER_DISC_NUMBER:
- {
- CStdString strDisc;
- if (tag.Loaded() && tag.GetDiscNumber() > 0)
- {
- strDisc.Format("%02i", tag.GetDiscNumber());
- return strDisc;
- }
- }
- break;
+ return GetItemLabel(item, LISTITEM_DISC_NUMBER);
case MUSICPLAYER_RATING:
return GetItemLabel(item, LISTITEM_RATING);
case MUSICPLAYER_COMMENT:
@@ -3769,6 +3762,13 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
return track;
}
+ case LISTITEM_DISC_NUMBER:
+ {
+ CStdString disc;
+ if (item->HasMusicInfoTag() && item->GetMusicInfoTag()->GetDiscNumber() > 0)
+ disc.Format("%02i", item->GetMusicInfoTag()->GetDiscNumber());
+ return disc;
+ }
case LISTITEM_ARTIST:
if (item->HasVideoInfoTag())
return item->GetVideoInfoTag()->m_strArtist;
diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h
index 512a16a838..632b3347f9 100644
--- a/xbmc/GUIInfoManager.h
+++ b/xbmc/GUIInfoManager.h
@@ -501,6 +501,7 @@ class CDateTime;
#define LISTITEM_PLAYCOUNT (LISTITEM_START + 56)
#define LISTITEM_LASTPLAYED (LISTITEM_START + 57)
#define LISTITEM_FOLDERPATH (LISTITEM_START + 58)
+#define LISTITEM_DISC_NUMBER (LISTITEM_START + 59)
#define LISTITEM_PROPERTY_START (LISTITEM_START + 200)
#define LISTITEM_PROPERTY_END (LISTITEM_PROPERTY_START + 1000)