![]() |
#8566 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
replace_metadatas support regular expressions, which should help. Unfortunately, I can't really help anymore than this - my few attempts didn't really work reliably
![]() |
![]() |
![]() |
![]() |
#8567 |
Member
![]() Posts: 20
Karma: 10
Join Date: Jan 2023
Device: none
|
Thanks anyway. I have tried experimenting with various regex to try to make it work. But I don't have enough experience/knowledge to make it work...
Any tips or directionality would be much appreciated. I don't mind messing around myself to try to make it work, I'm just out of my depth with no idea where to go. |
![]() |
![]() |
![]() |
#8568 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I got it roughly working. Play around with it here: https://regex101.com/r/rVliD2/1
I think this would be: Code:
ships=>((\d+)th Doctor)(/| & )(.*)=>\g<4>\g<3>\g<1> Also, you might need to change the 'th' part to something like (rd|th) for other Doctors. Last edited by ownedbycats; 06-28-2023 at 04:26 PM. |
![]() |
![]() |
![]() |
#8569 | |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
Detecting and moving one name out of a list to the front isn't difficult. Doing it while preserving the delimiters between names when the target name can be first, middle or last is a little trickier. Here's what I've come up with using named regexp grouping for clarity: Code:
# assume leading delim, otherwise, already first ships=>^(?P<pre>.*?)(?P<delim>[ ]*(&|/)[ ]*)(?P<first>Rose Tyler)(?P<post>.*)$=>\g<first>\g<delim>\g<pre>\g<post>
If you get the wild idea to apply more than one of these, remember that replace_metadata lines are applied in order, which in this case means the last line 'wins'. See INI-File wiki and add_to_keyword in particular if you try to get fancy with [defaults] vs different sites. Example: Code:
ships=>^(?P<pre>.*?)(?P<delim>[ ]*(&|/)[ ]*)(?P<first>Rose Tyler)(?P<post>.*)$=>\g<first>\g<delim>\g<pre>\g<post> ships=>^(?P<pre>.*?)(?P<delim>[ ]*(&|/)[ ]*)(?P<first>Jack Harkness)(?P<post>.*)$=>\g<first>\g<delim>\g<pre>\g<post> # Jack ends up before Rose when both appear. |
|
![]() |
![]() |
![]() |
#8570 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
For #2, AO3 doesn't mix ship-types/delimiters. I can't say about other sites, though.
|
![]() |
![]() |
![]() |
#8571 |
Member
![]() Posts: 20
Karma: 10
Join Date: Jan 2023
Device: none
|
Oh my god.
![]() ![]() ![]() My brain doesn't like it when ships don't follow a certain pattern and this is amazing. And so easy to adapt to other characters, which requires another thank you. Also thank you for the explanation of what the pieces are and the reminder that it reads top down. Hopefully this amazing guide helps others too. |
![]() |
![]() |
![]() |
#8572 | ||
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jun 2023
Device: kobo
|
The QuestionableQuesting Completeness Conundrum
Thanks for your answer.
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#8573 | ||
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
Take for example, the current Harry and the Shipgirls thread--something I wish I could download myself:
Quote:
Anything that could work for more than a few specific cases would end up being 'download the entire thread' in some form. Which I don't want to do because of server load--the potential for abuse is really just 'more server load', not a separate issue. |
||
![]() |
![]() |
![]() |
#8574 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
New Test Version Posted
2023-06-29 - Fix for specific cover error. |
![]() |
![]() |
![]() |
#8575 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#8576 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2023
Location: USA
Device: none
|
Error updating metadata from Fanfiction.net
Hello!
I'm brand new here although I've been reading posts ever since I discovered FFF a couple of years ago. I am grateful for the plugin - it allowed me to save my "fandom treasures" for a while now with minimal effort. So thank you very much for your work and your generosity in teaching even a novice such as me how to complete simple tasks to update my Calibre Library. I have an older PC with Windows 7, use Calibre version 3.48 and get fanfics mostly from Fanfiction.net, AO3 and StarsLibrary. My Calibre and FFF setup is not sophisticated by any means. Yesterday I have successfully downloaded a couple of new stories from Fanfiction.net; I also attempted to update an existing story and got an error message telling me that the ebook has been updated but the metadata has not. When I open the book in Calibre I can see in the story summary and in the created update log the new details (i.e. number of chapters and story update date) but the Calibre screen is not showing the new story update date (i.e. last update I had for the story was 5 chapters on March 13, 2023, today's download added 3 chapters and the Calibre screen table should show the most recent story update date of May 4, 2023 but it's still showing March 13, 2023). I apologize for being so long-winded. I tried running the Metadata update only and I get the same error. I have a debug file but can't figure out what went wrong. The last time I updated stories from FFnet was at the beginning of June with no issues and I'm not sure what I might have messed up on my PC since... I would really appreciate it if you could spare a little time to help me. Thank you very much. |
![]() |
![]() |
![]() |
#8577 | |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
When FFF attempted to set the Author field, Calibre ran into an issue with Windows denying write access to the story dir in the library: Code:
FFF: ERROR: 2023-06-30 13:17:45,960: calibre_plugins.fanficfare_plugin.fff_plugin(1801): Error Updating Metadata: Traceback (most recent call last): File "calibre_plugins.fanficfare_plugin.fff_plugin", line 1798, in update_books_loop File "calibre_plugins.fanficfare_plugin.fff_plugin", line 2272, in update_metadata File "site-packages\calibre\db\legacy.py", line 806, in func File "site-packages\calibre\db\cache.py", line 62, in call_func_with_lock File "site-packages\calibre\db\cache.py", line 1122, in set_field File "site-packages\calibre\db\cache.py", line 1136, in update_path File "site-packages\calibre\db\backend.py", line 1590, in update_path File "os.py", line 157, in makedirs WindowsError: [Error 5] Access is denied: u'C:\\Users\\STEVE\\Calibre Library - Copy\\Pink Hair and Roses\\Night Shift (11637)' A very common problem (I don't know if this error matches exactly) is trying to put your library in network/cloud storage. That is not supported by Calibre. Googling that error and Calibre finds some additional older threads. Using Win7, you may have trouble find anyone that can help you more specifically--it's very unsupported by now. |
|
![]() |
![]() |
![]() |
#8578 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2023
Location: USA
Device: none
|
Jimm, thank you so much for taking the time. I can't think of anything that might have happened in the past few weeks since my last update - I'll check my very outdated system... Thanks again, I'll also check the suggested reading resources.
Best always! |
![]() |
![]() |
![]() |
#8579 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Okay, this is weird.
![]() I just got a similar error to ronnie0602, occurring a couple lines earlier while setting most of the other book metadata. Except I'm on Win10 with Calibre 6.22. Code:
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\USER\\Documents\\Library\\Andrew Joshua Talon\\Paint and Powder (10896)' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "calibre_plugins.fanficfare_plugin.fff_plugin", line 1798, in update_books_loop File "calibre_plugins.fanficfare_plugin.fff_plugin", line 2268, in update_metadata File "calibre\db\legacy.py", line 588, in set_metadata File "calibre\db\cache.py", line 85, in call_func_with_lock File "calibre\db\cache.py", line 1691, in set_metadata File "calibre\db\cache.py", line 1686, in set_field File "calibre\db\cache.py", line 1481, in set_field File "calibre\db\backend.py", line 1726, in windows_check_if_files_in_use File "calibre\utils\copy_files.py", line 250, in windows_check_if_files_in_use File "calibre\utils\copy_files.py", line 136, in __enter__ File "calibre\utils\copy_files.py", line 132, in open_all_handles File "calibre\utils\copy_files.py", line 123, in _open_file File "calibre\utils\copy_files.py", line 112, in _open_file PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\USER\\Documents\\Library\\Andrew Joshua Talon\\Paint and Powder (10896)' Rebooting the OS seems to have cleared it. Unfortunately, I didn't find a good way to determine which processes have a file open until after I rebooted. Really wish I'd found that first. I'd chalk it up to weirdness from installing a JDK and an IDE this morning, but the similarity of ronnie0602's issue is concerning... |
![]() |
![]() |
![]() |
#8580 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Okay, I think I've figured out what caused mine, at least.
I went and did several of the things I did earlier today that I don't usually and managed to duplicate the error and then use Resource Monitor to ID the other process. Which was explore.exe--the basic Windows File Explorer. And one of the unusual things I had done was run a file search in File Explorer. Closing all the File Explorer windows (I'd left the search some time ago) closed the process after a short delay and I could rename that book again without error. I knew that an open File Explorer window into a dir could cause issues, but not that a search done hours ago could... ![]() |
![]() |
![]() |
![]() |
Tags |
fanfiction |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 523 | 07-15-2025 06:45 PM |
[GUI Plugin] Open With | kiwidude | Plugins | 404 | 02-21-2025 05:42 AM |
[GUI Plugin] Marvin XD | Philantrop | Plugins | 126 | 01-29-2017 12:48 PM |
[GUI Plugin] KiNotes | -axel- | Plugins | 0 | 07-14-2013 06:39 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |