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

Better handling of file name duplicates #144

Closed
WolfgangDpunkt opened this issue Jan 24, 2023 · 3 comments · Fixed by #145
Closed

Better handling of file name duplicates #144

WolfgangDpunkt opened this issue Jan 24, 2023 · 3 comments · Fixed by #145

Comments

@WolfgangDpunkt
Copy link

This also concerns the conversion of a large number of documents at once.
I have noticed that when Percollate finds the identical title in several files, it results in trying to save all the files under the identical file name, thus overwriting each other.
So if there are 50 html files with the same title, it ends up saving only one epub file.
Percollate should (optionally) rename duplicate files, for example by numbering them.

How can duplicate titles occur?
I could observe that this happens when the "og:title" is incorrectly set by an editor to the general name of the publication, not to the specific article title.

<meta property="og:title" content="newspaper name" />
<title>article name</title>

My manual solution was to remove the og:title everywhere by search/replace, then Percollate took the article name for the file name and everything went correctly.

Thank you for the attention to this matter, I appreciate it very much.

@danburzo
Copy link
Owner

Hi @WolfgangDpunkt, thanks for logging this issue. I've created the PR above to address this issue by appending -1, -2 etc. to overlapping filenames.

@danburzo
Copy link
Owner

The fix has been published in percollate@2.2.2.

@WolfgangDpunkt
Copy link
Author

Dear @danburzo ,

wow, that's a really quick solution!
Thank you very much, that's very kind.
I will test the new version as soon as possible.
Best regards
Wolfgang

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

Successfully merging a pull request may close this issue.

2 participants