Skip to content

Commit

Permalink
Merge pull request xbmc#7629 from ksooo/remove-dos-lineends
Browse files Browse the repository at this point in the history
[guiinfo] Remove DOS line ends introduced by 74262ff
  • Loading branch information
ksooo committed Jul 26, 2015
2 parents d44bc81 + 7655928 commit d648cd6
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions xbmc/GUIInfoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ const infomap mediacontainer[] = {{ "hasfiles", CONTAINER_HASFILES },
{ "pluginname", CONTAINER_PLUGINNAME },
{ "viewmode", CONTAINER_VIEWMODE },
{ "totaltime", CONTAINER_TOTALTIME },
{ "totalwatched", CONTAINER_TOTALWATCHED },
{ "totalunwatched", CONTAINER_TOTALUNWATCHED },
{ "totalwatched", CONTAINER_TOTALWATCHED },
{ "totalunwatched", CONTAINER_TOTALUNWATCHED },
{ "hasthumb", CONTAINER_HAS_THUMB },
{ "sortmethod", CONTAINER_SORT_METHOD },
{ "sortorder", CONTAINER_SORT_ORDER },
Expand Down Expand Up @@ -1870,35 +1870,35 @@ std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *
return ((CGUIMediaWindow *)window)->CurrentDirectory().GetProperty("showplot").asString();
}
break;
case CONTAINER_TOTALTIME:
case CONTAINER_TOTALWATCHED:
case CONTAINER_TOTALUNWATCHED:
{
CGUIWindow *window = GetWindowWithCondition(contextWindow, WINDOW_CONDITION_IS_MEDIA_WINDOW);
if (window)
{
const CFileItemList& items=((CGUIMediaWindow *)window)->CurrentDirectory();
int count=0;
for (int i=0;i<items.Size();++i)
{
// Iterate through container and count watched, unwatched and total duration.
CFileItemPtr item=items.Get(i);
if (info == CONTAINER_TOTALWATCHED && item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_playCount > 0)
count += 1;
else if (info == CONTAINER_TOTALUNWATCHED && item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_playCount == 0)
count += 1;
else if (info == CONTAINER_TOTALTIME && item->HasMusicInfoTag())
count += item->GetMusicInfoTag()->GetDuration();
else if (info == CONTAINER_TOTALTIME && item->HasVideoInfoTag())
count += item->GetVideoInfoTag()->m_streamDetails.GetVideoDuration();
}
if (info == CONTAINER_TOTALTIME && count > 0)
return StringUtils::SecondsToTimeString(count);
else if (info == CONTAINER_TOTALWATCHED || info == CONTAINER_TOTALUNWATCHED)
return StringUtils::Format("%i", count);
}
}
break;
case CONTAINER_TOTALTIME:
case CONTAINER_TOTALWATCHED:
case CONTAINER_TOTALUNWATCHED:
{
CGUIWindow *window = GetWindowWithCondition(contextWindow, WINDOW_CONDITION_IS_MEDIA_WINDOW);
if (window)
{
const CFileItemList& items=((CGUIMediaWindow *)window)->CurrentDirectory();
int count=0;
for (int i=0;i<items.Size();++i)
{
// Iterate through container and count watched, unwatched and total duration.
CFileItemPtr item=items.Get(i);
if (info == CONTAINER_TOTALWATCHED && item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_playCount > 0)
count += 1;
else if (info == CONTAINER_TOTALUNWATCHED && item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_playCount == 0)
count += 1;
else if (info == CONTAINER_TOTALTIME && item->HasMusicInfoTag())
count += item->GetMusicInfoTag()->GetDuration();
else if (info == CONTAINER_TOTALTIME && item->HasVideoInfoTag())
count += item->GetVideoInfoTag()->m_streamDetails.GetVideoDuration();
}
if (info == CONTAINER_TOTALTIME && count > 0)
return StringUtils::SecondsToTimeString(count);
else if (info == CONTAINER_TOTALWATCHED || info == CONTAINER_TOTALUNWATCHED)
return StringUtils::Format("%i", count);
}
}
break;
case SYSTEM_BUILD_VERSION_SHORT:
strLabel = CSysInfo::GetVersionShort();
break;
Expand Down

0 comments on commit d648cd6

Please sign in to comment.