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

Tag fix, some users couldnt use certain tags which caused the script to fail. #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from python:latest

COPY . .

RUN aptitude install mktorrent flac lame sox
RUN pip install -r requirements.txt

ENTRYPOINT ["python", "orpheusbetter.py"]
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.8'

services:
main:
build:
context: "."
dockerfile: "Dockerfile"
30 changes: 15 additions & 15 deletions orpheusbetter → orpheusbetter.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -272,21 +272,21 @@ def main():
needed = formats_needed(group, torrent, supported_formats)
print("Formats needed: {0}".format(', '.join(needed)))

if needed:
# Before proceeding, do the basic tag checks on the source
# files to ensure any uploads won't be reported, but punt
# on the tracknumber formatting; problems with tracknumber
# may be fixable when the tags are copied.
broken_tags = False
for flac_file in transcode.locate(flac_dir, transcode.ext_matcher('.flac')):
(ok, msg) = tagging.check_tags(flac_file, check_tracknumber_format=False)
if not ok:
print("A FLAC file in this release has unacceptable tags - skipping: {0}".format(msg))
print("You might be able to trump it.")
broken_tags = True
break
if broken_tags:
continue
# if needed:
# # Before proceeding, do the basic tag checks on the source
# # files to ensure any uploads won't be reported, but punt
# # on the tracknumber formatting; problems with tracknumber
# # may be fixable when the tags are copied.
# broken_tags = False
# for flac_file in transcode.locate(flac_dir, transcode.ext_matcher('.flac')):
# # (ok, msg) = tagging.check_tags(flac_file, check_tracknumber_format=False)
# # if not ok:
# # print("A FLAC file in this release has unacceptable tags - skipping: {0}".format(msg))
# # print("You might be able to trump it.")
# # broken_tags = True
# # break
# if broken_tags:
# continue

for format in needed:
if os.path.exists(flac_dir):
Expand Down
6 changes: 3 additions & 3 deletions transcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ def transcode(flac_file, output_dir, output_format):
raise TranscodeException('Transcode of file "{0}" failed: SIGPIPE'.format(flac_file))

tagging.copy_tags(flac_file, transcode_file)
(ok, msg) = tagging.check_tags(transcode_file)
if not ok:
raise TranscodeException('Tag check failed on transcoded file: {0}'.format(msg))
# (ok, msg) = tagging.check_tags(transcode_file)
# if not ok:
# raise TranscodeException('Tag check failed on transcoded file: {0}'.format(msg))

return transcode_file

Expand Down