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

an error occured, that has not been caught #200

Closed
weswitt opened this issue Oct 6, 2022 · 15 comments
Closed

an error occured, that has not been caught #200

weswitt opened this issue Oct 6, 2022 · 15 comments

Comments

@weswitt
Copy link

weswitt commented Oct 6, 2022

using m4b-tool v.0.4.2

the tool runs for a while and then crashes with this:

an error occured, that has not been caught:
Array
(
[type] => 8192
[message] => Return type of M4bTool\Audio\Tag::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
[file] => phar://D:/tools/m4b-tool/m4b-tool.phar/src/library/M4bTool/Audio/Tag.php
[line] => 158
)

@sandreas
Copy link
Owner

sandreas commented Oct 6, 2022

Hey there. Thanks for reporting. Would you mind trying out the latest pre-release?

As stated in the Important note of the documentation, m4b-tool 0.4.2 is very old and you should really use the latest pre-release. I also highly encourage you to try the official docker variant, which contains all the dependencies required to get the best results.

@sigito
Copy link

sigito commented Oct 10, 2022

Is it possible to install a pre-release version using homebrew? I get the same error. Thanks.

@sandreas
Copy link
Owner

Install 0.4.2 then just overwrite the m4b-tool.phar with the new one.

See https://github.com/sandreas/m4b-tool/releases/tag/latest for instructions.

I'll close this issue due to no further feedback. Feel free to reopen, if something is unclear or does not work.

@sigito
Copy link

sigito commented Oct 11, 2022

Totally the pre-release does its job. Also, the cover and description are properly located. It is indeed a big step forward.

Running the pre-release, even though completes successfully, prints out a lot of deprecation warnings and an error-like message (all in red):

could not tag file output-tmpfiles/tmp_outputm4b, error: Could not write tag for file output-tmpfiles/tmp_outputm4b:  (1)
#0 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/src/library/Audio/BinaryWrapper.php(273): M4bTool\Executables\Ffmpeg->writeTag(Object(SplFileInfo), Object(M4bTool\Audio\Tag), Object(M4bTool\Common\ConditionalFlags))
#1 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/src/library/Command/AbstractConversionCommand.php(260): M4bTool\Audio\BinaryWrapper->writeTag(Object(SplFileInfo), Object(M4bTool\Audio\Tag), Object(M4bTool\Common\ConditionalFlags))
#2 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/src/library/Command/MergeCommand.php(917): M4bTool\Command\AbstractConversionCommand->tagFile(Object(SplFileInfo), Object(M4bTool\Audio\Tag), Object(M4bTool\Common\ConditionalFlags))
#3 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/src/library/Command/MergeCommand.php(533): M4bTool\Command\MergeCommand->tagMergedFile(Object(SplFileInfo))
#4 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/src/library/Command/MergeCommand.php(424): M4bTool\Command\MergeCommand->processInputFiles()
#5 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/src/library/Command/MergeCommand.php(185): M4bTool\Command\MergeCommand->processFiles(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/vendor/symfony/console/Command/Command.php(255): M4bTool\Command\MergeCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(M4bTool\Command\MergeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 phar:///opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool/bin/m4b-tool.php(52): Symfony\Component\Console\Application->run()
#11 /opt/homebrew/Cellar/m4b-tool/0.4.2/bin/m4b-tool(10): require('phar:///opt/hom...')
#12 {main}

Not sure if this is relevant. Feel free to ignore if it is WAI.

@sandreas
Copy link
Owner

Not sure if this is relevant. Feel free to ignore if it is WAI.

@sigito Definitely relevant. Seems that the tags are not written to the file - and the filename is missing a . (output-tmpfiles/tmp_outputm4b). Could you please provide the full command you have executed?

@sandreas sandreas reopened this Oct 12, 2022
@sigito
Copy link

sigito commented Oct 12, 2022

I just ran m4b-tool merge -v --jobs=8 --output-file="output" "input".

Indeed, the final file did not have any chapters in it nor any metadata (based on the fact that Plex picked it up as [Unknown artist]).

@sandreas
Copy link
Owner

Ok, thank you. I think this is something that already has been reported somewhere. I'll take a look in the next days.

@sandreas
Copy link
Owner

sandreas commented Oct 14, 2022

So, just go be sure: You are really running the command with

--output-file="output"

without a file extension? Or did you mean output as a placeholder for the real output filename?

@sigito
Copy link

sigito commented Oct 14, 2022

Lol yeah 😃 Initially I ran it like that and just renamed the final file. The project's documentation suggests to run such a command.

@sigito
Copy link

sigito commented Oct 14, 2022

Oh wow, actually giving it an output filename with an extension produces a valid result. The book name is still incorrect, the initial file's state is preserved.

@sandreas
Copy link
Owner

sandreas commented Oct 15, 2022

So here we have at least 2 issues with m4b-tool, that have to be resolved:

  • The documentation has to be updated to contain an example with a valid output extension
  • If there is no output extension given, show a console warning and assume it is m4b

The problem is, that I did not find any place in the documentation without extension besides the auto generated help text of the command line:

  -o, --output-file=OUTPUT-FILE                  output file

Did you mean this? If not, could you please show me, where did you get this information from? I did not exactly understand your last comment:

The book name is still incorrect,

Is there hiding another issue in this text :-)? The book name is taken from the source files input tags, if you would like to change these you can use --name="My book name".

the initial file's state is preserved.

What do you mean by that? Is there still no tags in the file?

@weswitt
Copy link
Author

weswitt commented Oct 15, 2022

for me, using the pre-release version fixes the problem. so this can be closed

@sandreas
Copy link
Owner

for me, using the pre-release version fixes the problem. so this can be closed

@weswitt
Great, thank you for your feedback. With your permission I'll leave this issue open because although it is no longer relevant for you, I finally found 2 important improvements (see above), that lead to new issue submissions every now and then and after fixing the problems it will probably save me a lot of time.

@sigito
Copy link

sigito commented Oct 15, 2022

@sandreas

Did you mean this? If not, could you please show me, where did you get this information from?

I think the issue is that I did not read the docs line by line, so missed a warning that for --batch-pattern-feature the output needs to be a directory, but just used that command as a template for my own command. The reasoning was that it is the only command example that is present in an entire "Best practices" section.

Is there hiding another issue in this text :-)? The book name is taken from the source files input tags, if you would like to change these you can use --name="My book name".

I think it is again my bad. I assumed that we have the specific subdir structure under input directory, because the tool would use the dir names as a preferred metadata field values. The [Result](Series and single audiobooks have valid tags for genre, author, title, sorttitle, etc. from --batch-pattern usage) section of the "Best practices" lead me to believe in such a behavior: "Series and single audiobooks have valid tags for genre, author, title, sorttitle, etc. from --batch-pattern usage".

What do you mean by that? Is there still no tags in the file?

What I meant is what according to you is expected: "The book name is taken from the source files input tags". So no issue here either.

Thanks! I'd be more patient with reading the docs next time :)

@sandreas
Copy link
Owner

sandreas commented Mar 4, 2023

Moved to Issue roadmap summary (#231)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants