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

Method updateFile

syncplay/client.py:524–544  ·  view source on GitHub ↗
(self, filename, duration, path)

Source from the content-addressed store, hash-verified

522 self.userlist.currentUser.file["duration"] = self._playerPosition
523
524 def updateFile(self, filename, duration, path):
525 self.lastUpdatedFileTime = time.time()
526 newPath = ""
527 if utils.isURL(path):
528 filename = path
529 if not path:
530 return
531 try:
532 size = os.path.getsize(path)
533 except:
534 try:
535 path = path.decode('utf-8')
536 size = os.path.getsize(path)
537 except:
538 size = 0
539 if not utils.isURL(path) and os.path.exists(path):
540 self.fileSwitch.notifyUserIfFileNotInMediaDirectory(filename, path)
541 filename, size = self.__executePrivacySettings(filename, size)
542 self.userlist.currentUser.setFile(filename, duration, size, path)
543 self.sendFile()
544 self.playlist.changeToPlaylistIndexFromFilename(filename)
545
546 def setTrustedDomains(self, newTrustedDomains):
547 from syncplay.ui.ConfigurationGetter import ConfigurationGetter

Callers 1

_onFileUpdateMethod · 0.80

Calls 5

sendFileMethod · 0.95
setFileMethod · 0.45

Tested by

no test coverage detected