-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New hashing because old one wasn't working well Caching Action with selected playlist is now in another file so you can go back to playlist selection instead of restarting the playlist manger each time
- Loading branch information
Showing
5 changed files
with
121 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from plDownloading import * | ||
from editInfo import * | ||
from storedHashesManagement import * | ||
from addMap import addmap | ||
from remMap import remmap | ||
|
||
|
||
def plsel(PLpath, playlists, CMdirs, CMpath, settings, maps, selpl): | ||
while True: | ||
print('\n\nWhat do you want to do with this playlist :') | ||
print('delete, addmap, removemap, editinfo, download, exit') | ||
commands = ['DELETE', 'ADDMAP', 'REMOVEMAP', 'EDITINFO', 'DOWNLOAD', 'EXIT'] | ||
incom = input() | ||
if incom.upper() not in commands: | ||
print('The command doesn\'t seem right') | ||
else: | ||
if incom.upper() == 'DOWNLOAD': | ||
pldownload(maps, playlists, selpl, PLpath, CMpath) | ||
if settings["cacheMaps"]: | ||
print('Refreshing maps') | ||
refresh(CMpath, CMdirs) | ||
maps = loadmaps() | ||
print('Maps refreshed') | ||
|
||
elif incom.upper() == 'DELETE': | ||
while True: | ||
delcheck = input(f'Are you sure you want to delete "{playlists[selpl]["title"]}" (y/n)') | ||
if delcheck.upper() == 'Y': | ||
os.remove(PLpath + f'{playlists[selpl]["fileName"]}') | ||
print('Playlist deleted\nPress Enter to close.') | ||
input() | ||
exit() | ||
elif delcheck.upper() == 'N': | ||
break | ||
else: | ||
print('Please enter a correct letter\n\n') | ||
|
||
elif incom.upper() == 'EXIT': | ||
break | ||
|
||
elif incom.upper() == 'EDITINFO': | ||
edit_info(PLpath, playlists[selpl]['fileName']) | ||
|
||
elif incom.upper() == 'ADDMAP': | ||
addmap(PLpath, playlists[selpl]['fileName']) | ||
|
||
elif incom.upper() == 'REMOVEMAP': | ||
remmap(PLpath, playlists[selpl]['fileName']) | ||
|
||
else: | ||
print('This command is not yet implemented') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from getHash import gethash | ||
|
||
|
||
def loadmaps(): | ||
with open('./Settings/maps.txt', 'r+') as f: | ||
maps = f.read() | ||
maps = maps.split('\n') | ||
return maps | ||
|
||
|
||
def refresh(CMpath, CMdirs): | ||
maps = '' | ||
for item in CMdirs: | ||
maps += gethash(CMpath + item) + '\n' | ||
with open('./Settings/maps.txt', 'w+', encoding='utf-8') as f: | ||
f.write(maps) |