(self, path, shuffle=False)
| 2015 | return filename |
| 2016 | |
| 2017 | def loadPlaylistFromFile(self, path, shuffle=False): |
| 2018 | if not os.path.isfile(path): |
| 2019 | self._ui.showDebugMessage("Not loading {} as file could not be found".format(path)) |
| 2020 | return |
| 2021 | |
| 2022 | with open(path) as f: |
| 2023 | newPlaylist = f.read().splitlines() |
| 2024 | if shuffle: |
| 2025 | random.shuffle(newPlaylist) |
| 2026 | if newPlaylist: |
| 2027 | self.changePlaylist(newPlaylist, username=None, resetIndex=True) |
| 2028 | |
| 2029 | def savePlaylistToFile(self, path): |
| 2030 | with open(path, 'w') as playlistFile: |
no test coverage detected