Skip to content

Commit

Permalink
Fix the restarting of media again.
Browse files Browse the repository at this point in the history
Managed to remove a very important boolean :)

Also cleanup Announce function in PlexApplication.

Fixes xbmc#704
  • Loading branch information
Tobias Hieta committed Jun 18, 2014
1 parent 46887c4 commit 36d8c79
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions plex/PlexApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,30 +311,30 @@ void PlexApplication::Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char*
const char* message, const CVariant& data)
{
CLog::Log(LOGDEBUG, "PlexApplication::Announce got message %s:%s", sender, message);
{
CGUIDialogVideoOSD* osd
= (CGUIDialogVideoOSD*)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (osd)
CLog::Log(LOGDEBUG, "PlexApplication::Announce osd status, running: %s, openedfrompause: %s", osd->IsDialogRunning() ? "yes" : "no", osd->IsOpenedFromPause() ? "yes" : "no");
}

if (flag == ANNOUNCEMENT::Player && stricmp(sender, "xbmc") == 0 &&
stricmp(message, "OnStop") == 0)
if (flag == ANNOUNCEMENT::Player && stricmp(sender, "xbmc") == 0)
{
if (g_plexApplication.playQueueManager->getCurrentPlayQueueType() == PLEX_MEDIA_TYPE_VIDEO)
if (stricmp(message, "OnPlay") == 0)
{
m_triedToRestart = false;
}
else if (stricmp(message, "OnStop") == 0)
{
CFileItemList list;
CFileItemPtr lastItem;
if (g_plexApplication.playQueueManager->getCurrentPlayQueueType() == PLEX_MEDIA_TYPE_VIDEO)
{
CFileItemList list;
CFileItemPtr lastItem;

if (g_plexApplication.playQueueManager->getCurrentPlayQueue(list) && list.Get(list.Size() - 1))
lastItem = list.Get(list.Size() - 1);
if (g_plexApplication.playQueueManager->getCurrentPlayQueue(list) && list.Get(list.Size() - 1))
lastItem = list.Get(list.Size() - 1);

if (lastItem && lastItem->HasMusicInfoTag() && g_application.CurrentFileItemPtr() &&
lastItem->GetProperty("playQueueItemID").asInteger() ==
if (lastItem && lastItem->HasMusicInfoTag() && g_application.CurrentFileItemPtr() &&
lastItem->GetProperty("playQueueItemID").asInteger() ==
g_application.CurrentFileItemPtr()->GetProperty("playQueueItemID").asInteger(-1))
{
CLog::Log(LOGDEBUG, "PlexApplication::Announce clearing video playQueue");
g_plexApplication.playQueueManager->clear();
{
CLog::Log(LOGDEBUG, "PlexApplication::Announce clearing video playQueue");
g_plexApplication.playQueueManager->clear();
}
}
}
}
Expand Down

0 comments on commit 36d8c79

Please sign in to comment.