Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config option to control output of desc.txt and narrator.txt #17

Merged
merged 2 commits into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions audible.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def __init__(self):
'fetch_art': True,
'match_chapters': True,
'source_weight': 0.0,
'write_description_file': True,
'write_reader_file': True,
'include_narrator_in_artists': True,
'goodreads_apikey': None
})
Expand Down Expand Up @@ -447,11 +449,13 @@ def write_book_description_and_narrator(self, items):
item = items[0]
destination = os.path.dirname(item.path)

description = item.comments
with open(os.path.join(destination, b'desc.txt'), 'w') as f:
f.write(description)
if self.config['write_description_file']:
description = item.comments
with open(os.path.join(destination, b'desc.txt'), 'w') as f:
f.write(description)

narrator = item.composer
with open(os.path.join(destination, b'reader.txt'), 'w') as f:
f.write(narrator)
if self.config['write_reader_file']:
narrator = item.composer
with open(os.path.join(destination, b'reader.txt'), 'w') as f:
f.write(narrator)

2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ This Beets plugin solves both problems.
source_weight: 0.0 # disable the source_weight penalty
fetch_art: true # whether to retrieve cover art
include_narrator_in_artists: true # include author and narrator in artist tag. Or just author
write_description_file: true # output desc.txt
write_reader_file: true # output reader.txt

copyartifacts:
extensions: .yml # so that metadata.yml is copied, see below
Expand Down