Skip to content

Commit

Permalink
jsonrpc: fix setting/updating resume point in VideoLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed Jan 11, 2014
1 parent 20717c1 commit 57e7305
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion xbmc/interfaces/json-rpc/ServiceDescription.h
Expand Up @@ -22,7 +22,7 @@
namespace JSONRPC
{
const char* const JSONRPC_SERVICE_ID = "http://xbmc.org/jsonrpc/ServiceDescription.json";
const char* const JSONRPC_SERVICE_VERSION = "6.13.2";
const char* const JSONRPC_SERVICE_VERSION = "6.13.3";
const char* const JSONRPC_SERVICE_DESCRIPTION = "JSON-RPC API of XBMC";

const char* const JSONRPC_SERVICE_TYPES[] = {
Expand Down
17 changes: 8 additions & 9 deletions xbmc/interfaces/json-rpc/VideoLibrary.cpp
Expand Up @@ -980,15 +980,14 @@ void CVideoLibrary::UpdateResumePoint(const CVariant &parameterObject, CVideoInf
else
{
CBookmark bookmark;
if (videodatabase.GetResumeBookMark(details.m_strFileNameAndPath, bookmark))
{
bookmark.timeInSeconds = position;

int total = (int)parameterObject["resume"]["total"].asInteger();
if (total > 0)
bookmark.totalTimeInSeconds = total;
videodatabase.AddBookMarkToFile(details.m_strFileNameAndPath, bookmark, CBookmark::RESUME);
}
int total = (int)parameterObject["resume"]["total"].asInteger();
if (total <= 0 && !videodatabase.GetResumeBookMark(details.m_strFileNameAndPath, bookmark))
bookmark.totalTimeInSeconds = details.m_streamDetails.GetVideoDuration();
else
bookmark.totalTimeInSeconds = total;

bookmark.timeInSeconds = position;
videodatabase.AddBookMarkToFile(details.m_strFileNameAndPath, bookmark, CBookmark::RESUME);
}
}
}
Expand Down

0 comments on commit 57e7305

Please sign in to comment.