MCPcopy Create free account
hub / github.com/Syncplay/syncplay / getFileSwitchState

Method getFileSwitchState

syncplay/ui/gui.py:566–579  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

564
565 @needsClient
566 def getFileSwitchState(self, filename):
567 if filename:
568 if filename == getMessage("nofile-note"):
569 return constants.FILEITEM_SWITCH_NO_SWITCH
570 if self._syncplayClient.userlist.currentUser.file and utils.sameFilename(filename, self._syncplayClient.userlist.currentUser.file['name']):
571 return constants.FILEITEM_SWITCH_NO_SWITCH
572 if isURL(filename):
573 return constants.FILEITEM_SWITCH_STREAM_SWITCH
574 elif filename not in self.newWatchlist:
575 if self._syncplayClient.fileSwitch.findFilepath(filename):
576 return constants.FILEITEM_SWITCH_FILE_SWITCH
577 else:
578 self.newWatchlist.extend([filename])
579 return constants.FILEITEM_SWITCH_NO_SWITCH
580
581 @needsClient
582 def isItemUntrusted(self, filename):

Callers 1

showUserListMethod · 0.95

Calls 3

getMessageFunction · 0.90
isURLFunction · 0.90
findFilepathMethod · 0.80

Tested by

no test coverage detected