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

calibredb-fetch-and-set-metadata-by-isbn does not work on Windows #65

Open
drcxd opened this issue Jan 10, 2023 · 4 comments
Open

calibredb-fetch-and-set-metadata-by-isbn does not work on Windows #65

drcxd opened this issue Jan 10, 2023 · 4 comments

Comments

@drcxd
Copy link

drcxd commented Jan 10, 2023

Executing that command by pressing s i and then enter the isbn number in *calibre-search* buffer results in the following output in *Messages* buffer.

D:/program/calibre/Calibre/fetch-ebook-metadata.exe -p "Google" --isbn "978-0-321-39952-6" 2>/dev/null
D:/program/calibre/Calibre/fetch-ebook-metadata.exe -p "Amazon.com" --isbn "978-0-321-39952-6" 2>/dev/null

"No metadata retrieved from sources"

Executing that command in Windows Powershell leads to the following error:

PS D:\program\calibre\Calibre> D:/program/calibre/Calibre/fetch-ebook-metadata.exe -p "Google" --isbn "978-0-321-39952-6" 2>/dev/null
out-file : Could not find a part of the path 'D:\dev\null'.
At line:1 char:1
+ D:/program/calibre/Calibre/fetch-ebook-metadata.exe -p "Google" --isb ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (:) [Out-File], DirectoryNotFoundException
    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

Removing the 2>/dev/null/ leads to correct behavior:

PS D:\program\calibre\Calibre> D:/program/calibre/Calibre/fetch-ebook-metadata.exe -p "Google" --isbn "978-0-321-39952-6"
Title               : Computer Graphics: Principles and Practice
Author(s)           : John F. Hughes & Andries van Dam & Morgan McGuire & James D. Foley & David Sklar & Steven K. Feiner & Kurt Akeley
Publisher           : Addison-Wesley
Tags                : Computers, Software Development & Engineering, Computer Graphics
Languages           : eng
Published           : 2014-01-15T12:18:30.570926+00:00
Identifiers         : google:OVpsAQAAQBAJ, isbn:9780321399526
Comments            : <p>Computer Graphics: Principles and Practice, Third Edition,remains the most authoritative introduction to the field. The first edition, the original “Foley and van Dam,” helped to define computer graphics and how it could be taught. The second edition became an even more comprehensive resource for practitioners and students alike. This third edition has been completely rewritten to provide detailed and up-to-date coverage of key concepts, algorithms, technologies, and applications.</p>
...

I guess the 2>/dev/null/ is not platform-independent?

@chenyanming
Copy link
Owner

Yes, this would abandom errors on unix.

@drcxd
Copy link
Author

drcxd commented Jan 10, 2023

Do you plan to support this command on Windows?

@chenyanming
Copy link
Owner

Let me check on later days.

@drcxd
Copy link
Author

drcxd commented Jan 10, 2023

Found the equivalence of /dev/null here. https://stackoverflow.com/questions/313111/is-there-a-dev-null-on-windows

I tried to modify the code fetching metadata by ISBN, changing /dev/null to $null. The fetching part seems worked, but the rest of the command seems doing wrong...

I checked some code here

:library (format "--library-path \"%s\"" calibredb-root-dir)))

To me, it looks like no matter which library I am in and which book's metadata I am fetching, the program end up setting metadata of some book with the same ID in the default library?

Also, there are some other issues here.

First, there are some coding issues in the comments fetched.

image

When executing the command in Windows Powershell, no coding issue occurs.
image

My operating system's default language is English.

Second, some error messages are written into the Author Sort part of the metadata.
image
I did not set calibredb-debug-program, but I assume this error message should not be written there?

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

2 participants