aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/skin.estuary/xml/Variables.xml2
-rw-r--r--xbmc/FileItem.cpp27
-rw-r--r--xbmc/FileItem.h4
-rw-r--r--xbmc/guilib/guiinfo/VideoGUIInfo.cpp6
-rw-r--r--xbmc/video/VideoUtils.cpp28
5 files changed, 40 insertions, 27 deletions
diff --git a/addons/skin.estuary/xml/Variables.xml b/addons/skin.estuary/xml/Variables.xml
index 7541e834af..f3787b1f05 100644
--- a/addons/skin.estuary/xml/Variables.xml
+++ b/addons/skin.estuary/xml/Variables.xml
@@ -452,9 +452,9 @@
</variable>
<variable name="ListWatchedIconVar">
<value condition="ListItem.IsRecording">windows/pvr/record.png</value>
+ <value condition="ListItem.IsCollection">overlays/set.png</value>
<value condition="ListItem.IsPlaying">overlays/watched/OverlayPlaying-List.png</value>
<value condition="ListItem.IsResumable">overlays/watched/resume.png</value>
- <value condition="ListItem.IsCollection">overlays/set.png</value>
<value condition="ListItem.IsFolder + String.IsEmpty(Listitem.dbtype) + !String.IsEqual(ListItem.Overlay,OverlayWatched.png) + !ListItem.IsParentFolder">overlays/folder.png</value>
<value condition="!String.IsEmpty(ListItem.Overlay)">$INFO[ListItem.Overlay]</value>
<value condition="!ListItem.IsParentFolder">OverlayUnwatched.png</value>
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index 2eb5eb072c..77ad297a7a 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -4032,5 +4032,30 @@ bool CFileItem::GetCurrentResumeTimeAndPartNumber(int64_t& startOffset, int& par
bool CFileItem::IsResumable() const
{
- return (!IsNFO() && !IsPlayList()) || IsType(".strm");
+ if (m_bIsFolder)
+ {
+ int64_t watched = 0;
+ int64_t inprogress = 0;
+ int64_t total = 0;
+ if (HasProperty("inprogressepisodes"))
+ {
+ // show/season
+ watched = GetProperty("watchedepisodes").asInteger();
+ inprogress = GetProperty("inprogressepisodes").asInteger();
+ total = GetProperty("totalepisodes").asInteger();
+ }
+ else if (HasProperty("inprogress"))
+ {
+ // movie set
+ watched = GetProperty("watched").asInteger();
+ inprogress = GetProperty("inprogress").asInteger();
+ total = GetProperty("total").asInteger();
+ }
+
+ return ((total != watched) && (inprogress > 0 || watched != 0));
+ }
+ else
+ {
+ return HasVideoInfoTag() && GetVideoInfoTag()->GetResumePoint().IsPartWay();
+ }
}
diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h
index e0adc28e4d..464ce10a35 100644
--- a/xbmc/FileItem.h
+++ b/xbmc/FileItem.h
@@ -369,7 +369,9 @@ public:
/*!
* \brief Test if this item type can be resumed.
- * \return True if this item can be resumed, false otherwise.
+ * \return True if this item is a folder and has at least one child with a partway resume bookmark
+ * or at least one unwatched child or if it is not a folder, if it has a partway resume bookmark,
+ * false otherwise.
*/
bool IsResumable() const;
diff --git a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
index 794434f94a..3a6b0daf5a 100644
--- a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
@@ -748,9 +748,6 @@ bool CVideoGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int contextW
/////////////////////////////////////////////////////////////////////////////////////////////
// LISTITEM_*
/////////////////////////////////////////////////////////////////////////////////////////////
- case LISTITEM_IS_RESUMABLE:
- value = tag->GetResumePoint().timeInSeconds > 0;
- return true;
case LISTITEM_IS_COLLECTION:
value = tag->m_type == MediaTypeVideoCollection;
return true;
@@ -803,6 +800,9 @@ bool CVideoGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int contextW
///////////////////////////////////////////////////////////////////////////////////////////////
// LISTITEM_*
///////////////////////////////////////////////////////////////////////////////////////////////
+ case LISTITEM_IS_RESUMABLE:
+ value = item->IsResumable();
+ return true;
case LISTITEM_IS_STEREOSCOPIC:
{
std::string stereoMode = item->GetProperty("stereomode").asString();
diff --git a/xbmc/video/VideoUtils.cpp b/xbmc/video/VideoUtils.cpp
index 56edaad209..2f61e2c474 100644
--- a/xbmc/video/VideoUtils.cpp
+++ b/xbmc/video/VideoUtils.cpp
@@ -659,38 +659,24 @@ ResumeInformation GetFolderItemResumeInformation(const CFileItem& item)
}
}
- int64_t watched = 0;
- int64_t inprogress = 0;
- int64_t total = 0;
- if (folderItem.HasProperty("inprogressepisodes"))
- {
- // show/season
- watched = folderItem.GetProperty("watchedepisodes").asInteger();
- inprogress = folderItem.GetProperty("inprogressepisodes").asInteger();
- total = folderItem.GetProperty("totalepisodes").asInteger();
- }
- else if (folderItem.HasProperty("inprogress"))
- {
- // movie set
- watched = folderItem.GetProperty("watched").asInteger();
- inprogress = folderItem.GetProperty("inprogress").asInteger();
- total = folderItem.GetProperty("total").asInteger();
- }
-
- if ((total != watched) && (inprogress > 0 || watched != 0))
+ if (folderItem.IsResumable())
{
ResumeInformation resumeInfo;
resumeInfo.isResumable = true;
return resumeInfo;
}
- CLog::LogF(LOGERROR, "Cannot obtain inprogress state for {}", folderItem.GetPath());
return {};
}
ResumeInformation GetNonFolderItemResumeInformation(const CFileItem& item)
{
- if (!item.IsResumable())
+ // do not resume nfo files
+ if (item.IsNFO())
+ return {};
+
+ // do not resume playlists, except strm files
+ if (!item.IsType("strm") && item.IsPlayList())
return {};
// do not resume Live TV and 'deleted' items (e.g. trashed pvr recordings)