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

Method notifyUserIfFileNotInMediaDirectory

syncplay/client.py:2361–2378  ·  view source on GitHub ↗
(self, filenameToFind, path)

Source from the content-addressed store, hash-verified

2359 return False
2360
2361 def notifyUserIfFileNotInMediaDirectory(self, filenameToFind, path):
2362 directoryToFind = os.path.dirname(path)
2363 if directoryToFind in self.mediaDirectoriesNotFound:
2364 return
2365 if self.mediaDirectories is not None and self.mediaFilesCache is not None:
2366 if directoryToFind in self.mediaFilesCache:
2367 return
2368 for directory in self.mediaFilesCache:
2369 files = self.mediaFilesCache[directory]
2370 if filenameToFind in files:
2371 return
2372 if directoryToFind in self.mediaFilesCache:
2373 return
2374 if self.isDirectoryInList(directoryToFind, self.mediaDirectories):
2375 return
2376 directoryToFind = str(directoryToFind)
2377 self._client.ui.showErrorMessage(getMessage("added-file-not-in-media-directory-error").format(directoryToFind))
2378 self.mediaDirectoriesNotFound.append(directoryToFind)

Callers 2

updateFileMethod · 0.80
addFileToPlaylistMethod · 0.80

Calls 3

isDirectoryInListMethod · 0.95
getMessageFunction · 0.90
showErrorMessageMethod · 0.45

Tested by

no test coverage detected