Skip to content

Commit

Permalink
Updating to phv-v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggimon committed Aug 2, 2014
2 parents c0be2b7 + 5791546 commit bdd03dd
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ endif()

set(PLEX_VERSION_MAJOR 1)
set(PLEX_VERSION_MINOR 2)
set(PLEX_VERSION_PATCH 0)
set(PLEX_VERSION_PATCH 1)
if(DEFINED ENV{BUILD_NUMBER})
set(PLEX_VERSION_BUILD "$ENV{BUILD_NUMBER}")
set(PLEX_VERSION_BUILD_NR "$ENV{BUILD_NUMBER}")
Expand Down
26 changes: 20 additions & 6 deletions plex/Playlists/PlexPlayQueueLocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ void CPlexPlayQueueLocal::removeItem(const CFileItemPtr& item)
ePlexMediaType type = PlexUtils::GetMediaTypeFromItem(item);
if (m_list)
{
m_list->Remove(item.get());
CApplicationMessenger::Get().PlexUpdatePlayQueue(type, false);
for (int i = 0; i < m_list->Size(); i++)
{
if (m_list->Get(i)->GetProperty("playQueueItemID").asString() ==
item->GetProperty("playQueueItemID").asString())
{
m_list->Remove(m_list->Get(i).get());
OnPlayQueueUpdated(type, false);
return;
}
}
}
}

Expand All @@ -57,7 +65,7 @@ bool CPlexPlayQueueLocal::addItem(const CFileItemPtr& item, bool next)
{
m_list->Add(item);
}
CApplicationMessenger::Get().PlexUpdatePlayQueue(type, false);
OnPlayQueueUpdated(type, false);
return true;
}
return false;
Expand All @@ -75,8 +83,7 @@ int CPlexPlayQueueLocal::getCurrentID()
void CPlexPlayQueueLocal::get(const CStdString& playQueueID, const CPlexPlayQueueOptions &options)
{
if (m_list && m_list->GetProperty("playQueueID").asString() == playQueueID)
CApplicationMessenger::Get().PlexUpdatePlayQueue(PlexUtils::GetMediaTypeFromItem(m_list),
options.startPlaying);
OnPlayQueueUpdated(PlexUtils::GetMediaTypeFromItem(m_list), options.startPlaying);
}

///////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -134,6 +141,13 @@ void CPlexPlayQueueLocal::OnJobComplete(unsigned int jobID, bool success, CJob*

m_list->SetProperty("playQueueIsLocal", true);

CApplicationMessenger::Get().PlexUpdatePlayQueue(type, fj->m_options.startPlaying);
OnPlayQueueUpdated(type, fj->m_options.startPlaying);
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////
void CPlexPlayQueueLocal::OnPlayQueueUpdated(ePlexMediaType type, bool startPlaying)
{
m_list->SetProperty("size", m_list->Size());
CApplicationMessenger::Get().PlexUpdatePlayQueue(type, startPlaying);
}
1 change: 1 addition & 0 deletions plex/Playlists/PlexPlayQueueLocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class CPlexPlayQueueLocal : public IPlexPlayQueueBase, public IJobCallback

private:
void OnJobComplete(unsigned int jobID, bool success, CJob *job);
void OnPlayQueueUpdated(ePlexMediaType type, bool startPlaying);
CFileItemListPtr m_list;
CPlexServerPtr m_server;
};
Expand Down
9 changes: 6 additions & 3 deletions plex/Playlists/PlexPlayQueueServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ bool CPlexPlayQueueServer::create(const CFileItem& container, const CStdString&
u.AddOptions(options.urlOptions);

// add trailers option count to creation url if required
int trailerCount = g_guiSettings.GetInt("videoplayer.playtrailercount");
if ((trailerCount) && (container.GetProperty("viewOffset").asInteger() == 0))
u.SetOption("extrasPrefixCount", boost::lexical_cast<std::string>(trailerCount));
if (container.GetPlexDirectoryType() == PLEX_DIR_TYPE_MOVIE)
{
int trailerCount = g_guiSettings.GetInt("videoplayer.playtrailercount");
if ((trailerCount) && (container.GetProperty("viewOffset").asInteger() == 0))
u.SetOption("extrasPrefixCount", boost::lexical_cast<std::string>(trailerCount));
}

return sendRequest(u, "POST", options);
}
Expand Down
4 changes: 4 additions & 0 deletions plex/ReleaseNotes/1.2.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

* Fixes
- Fix avoid cinema trailers to play before a TV Show

0 comments on commit bdd03dd

Please sign in to comment.