Browse Source

Code refactoring

Rename mame_directory to mame-directory to be more consistent
pull/2/head
djib 5 months ago
parent
commit
7b5196fb11
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      PDMameUpdate.py
  2. +1
    -1
      config.template.json

+ 4
- 4
PDMameUpdate.py View File

@@ -63,7 +63,7 @@ def fetch_local_torrents():
"""Fetches local torrents versions"""
logging.info('Fetching current MAME versions')
directories = os.listdir(config['mame_directory'])
directories = os.listdir(config['mame-directory'])
for directory in directories:
match = re_mame_version.match(directory)
if match:
@@ -173,14 +173,14 @@ def update_torrents():
"""
logging.info('Updating torrents')
for torrent in torrents.values():
old_name = os.path.join(config['mame_directory'], torrent['local-name'])
new_name = os.path.join(config['mame_directory'], torrent['remote-name'])
old_name = os.path.join(config['mame-directory'], torrent['local-name'])
new_name = os.path.join(config['mame-directory'], torrent['remote-name'])
client.torrent.remove(torrent['transmission-id']);
os.rename(old_name, new_name)
client.torrent.add(
filename=torrent['remote-link'],
download_dir=config['mame_directory'],
download_dir=config['mame-directory'],
cookies=cookies,
paused=False
)

+ 1
- 1
config.template.json View File

@@ -1,5 +1,5 @@
{
"mame_directory":"/path/to/your/locol/mame/torrent/target/folders",
"mame-directory":"/path/to/your/locol/mame/torrent/target/folders",
"transmission-user":"user",
"transmission-password":"pass",
"pleasuredome-user":"user",

Loading…
Cancel
Save