Stop playlist at end (with optional loop setting for multi-file playlists)

This commit is contained in:
Et0h 2016-01-31 11:10:47 +00:00
parent 9a0ea78be3
commit 5016e9d102
2 changed files with 10 additions and 4 deletions

View File

@ -479,6 +479,9 @@ class SyncplayClient(object):
def changeToPlaylistIndex(self, *args, **kwargs):
self.playlist.changeToPlaylistIndex(*args, **kwargs)
def isPlaylistLoopingEnabled(self):
return self._config["loopAtEndOfPlaylist"]
def __executePrivacySettings(self, filename, size):
if self._config['filenamePrivacyMode'] == PRIVACY_SENDHASHED_MODE:
filename = utils.hashFilename(filename)
@ -1485,8 +1488,6 @@ class SyncplayPlaylist():
return
if self._thereIsNextPlaylistIndex():
self.switchToNewPlaylistIndex(self._nextPlaylistIndex(), resetPosition=True)
else:
self._client.rewindFile()
def _updateUndoPlaylistBuffer(self, newPlaylist, newRoom):
if self._playlistBufferIsFromOldRoom(newRoom):
@ -1513,6 +1514,8 @@ class SyncplayPlaylist():
return False
elif len(self._playlist) == 1:
return False
elif self._playlistIsAtEnd():
return self._client.isPlaylistLoopingEnabled()
else:
return True

View File

@ -35,6 +35,7 @@ class ConfigurationGetter(object):
"perPlayerArguments": None,
"mediaSearchDirectories": None,
"sharedPlaylistEnabled": True,
"loopAtEndOfPlaylist": False,
"file": None,
"playerArgs": [],
"playerClass": None,
@ -105,7 +106,8 @@ class ConfigurationGetter(object):
"showSameRoomOSD",
"showNonControllerOSD",
"showDurationNotification",
"sharedPlaylistEnabled"
"sharedPlaylistEnabled",
"loopAtEndOfPlaylist"
]
self._tristate = [
"checkForUpdatesAutomatically",
@ -136,7 +138,8 @@ class ConfigurationGetter(object):
"filesizePrivacyMode", "unpauseAction",
"pauseOnLeave", "readyAtStart", "autoplayMinUsers",
"autoplayInitialState", "mediaSearchDirectories",
"sharedPlaylistEnabled", "playerCommandDelay"],
"sharedPlaylistEnabled", "playerCommandDelay",
"loopAtEndOfPlaylist"],
"gui": ["showOSD", "showOSDWarnings", "showSlowdownOSD",
"showDifferentRoomOSD", "showSameRoomOSD",
"showNonControllerOSD", "showDurationNotification"],