Fix (#9): don't clobber max/keep in show info file
Change: dump config file when existing file misses one or more settings
This commit is contained in:
parent
e329c25d2c
commit
140cf50a47
3 changed files with 10 additions and 7 deletions
|
@ -103,6 +103,7 @@ class Config:
|
|||
for key in CONFIG_VALUES:
|
||||
if key not in cls.Values:
|
||||
cls.Values[key] = cls.parse_arg_value(key, CONFIG_VALUES[key]['default'])
|
||||
dump_config=True
|
||||
|
||||
# Override config from commandline arguments
|
||||
|
||||
|
|
|
@ -597,7 +597,7 @@ foreach (array_keys($feeds) as $url) {
|
|||
}
|
||||
}
|
||||
|
||||
$TRANSCODE_ENABLED=($config['TRANSCODE'] == "True") ? true : false ;
|
||||
$TRANSCODE_ENABLED=($config['TRANSCODE'] == "True") ? true : false;
|
||||
$LOG_LEVEL=$config['LOG_LEVEL'];
|
||||
$UPDATE_ENABLED=$settings['update_enabled'];
|
||||
$UPDATE_START=$settings['update_start'];
|
||||
|
|
|
@ -189,12 +189,14 @@ def download_episode(episode_id) -> None:
|
|||
show_index_file_name = os.path.join(show_directory, f"{RSS_FEED_SHOW_INDEX}.{RSS_FEED_INFO_EXTENSION}")
|
||||
if not os.path.isfile(show_index_file_name) or int(get_index_version(show_index_file_name)) < Spodcast.CONFIG.get_version_int():
|
||||
podcast_name, link, description, image = get_info(episode_id, "show")
|
||||
show_info = {
|
||||
"version": str(RSS_FEED_VERSION + Spodcast.CONFIG.get_version_str()),
|
||||
"title": escape(podcast_name),
|
||||
"link": link,
|
||||
"description": escape(description),
|
||||
"image": RSS_FEED_SHOW_IMAGE }
|
||||
show_info = {}
|
||||
if os.path.isfile(show_index_file_name):
|
||||
show_info = json_load(show_index_file_name)
|
||||
show_info["version"] = str(RSS_FEED_VERSION + Spodcast.CONFIG.get_version_str())
|
||||
show_info["title"] = escape(podcast_name)
|
||||
show_info["link"] = link
|
||||
show_info["description"] = escape(description)
|
||||
show_info["image"] = RSS_FEED_SHOW_IMAGE
|
||||
show_index_file = open(show_index_file_name, "w")
|
||||
show_index_file.write(json.dumps(show_info))
|
||||
show_index_file.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue