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

Method findFilepath

syncplay/client.py:2309–2329  ·  view source on GitHub ↗
(self, filename, highPriority=False)

Source from the content-addressed store, hash-verified

2307 self._client.fileSwitchFoundFiles()
2308
2309 def findFilepath(self, filename, highPriority=False):
2310 if filename is None:
2311 return
2312
2313 if self._client.userlist.currentUser.file and utils.sameFilename(filename, self._client.userlist.currentUser.file['name']):
2314 return self._client.userlist.currentUser.file['path']
2315
2316 if self.mediaFilesCache is not None:
2317 for directory in self.mediaFilesCache:
2318 files = self.mediaFilesCache[directory]
2319 if len(files) > 0 and filename in files:
2320 filepath = os.path.join(directory, filename)
2321 if os.path.isfile(filepath):
2322 return filepath
2323
2324 if self.folderSearchEnabled and self.mediaDirectories is not None:
2325 directoryList = self.mediaDirectories
2326 for directory in directoryList:
2327 filepath = os.path.join(directory, filename)
2328 if os.path.isfile(filepath):
2329 return filepath
2330
2331 def areWatchedFilenamesInCache(self):
2332 if self.filenameWatchlist is not None:

Callers 9

loadDelayedPathMethod · 0.80
getFileSwitchStateMethod · 0.80
isFileAvailableMethod · 0.80
openPlaylistMenuMethod · 0.80
openRoomMenuMethod · 0.80
playlistItemClickedMethod · 0.80
roomClickedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected