Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 06-30-2017, 03:12 PM   #2296
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
The only place I can see the characters at all is at the search site where there is a category which enables me to search for stories based on the one character on the list.

When I download a story even though I can find it based on a character it doesn't show those characters anywhere in the downloaded story's metadata (not even in the metadata-column).

I had thought that I could use the search function on the site and add the character in the search to the characters column I have in my metadata, and it worked fine until I stumbled across a story to which I've already added a character. It then deleted the existing metadata. This only happens when I select multiple stories.
Tanjamuse is offline   Reply With Quote
Old 06-30-2017, 04:32 PM   #2297
dennocoil
Member
dennocoil began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2016
Device: Samsung S6 Phone
After much trial and error, I got the concept of how it's supposed to work and it works now. Just to get some clarification, what does this have to do in relation to everything else?
Code:
extra_valid_entries:likes
likes_label:Likes
dennocoil is offline   Reply With Quote
Old 06-30-2017, 04:43 PM   #2298
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,328
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Quote:
Originally Posted by dennocoil View Post
After much trial and error, I got the concept of how it's supposed to work and it works now. Just to get some clarification, what does this have to do in relation to everything else?
Code:
extra_valid_entries:likes
likes_label:Likes
What I call "standard" metadata entries are hard coded and common to most adapters. Standard list entries Standard scalar entries

Many site adapters have what I call "site specific" metadata entries that they collect. The system is informed about these using extra_valid_entries so it knows to add them to the list (they are added as 'list' entries rather than scalar). Only valid entries can be included in title pages, used in replace_metadata, added to extra_subject_tags, etc.

An individual user can also add their own for even more sophisticated processing.

Any valid metadata entry, either standard or 'extra' can be given a label with <entryname>_label that will be used in the titlepage and logpage. If <entryname>_label is not present, Python's .title() function will be applied to the entry name. See code.
JimmXinu is offline   Reply With Quote
Old 07-01-2017, 02:40 AM   #2299
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
I've found a solution to my problem with adding new characters. It may not be the most elegant, but it's working.
Attached Thumbnails
Click image for larger version

Name:	Skærmbillede 2017-07-01 08.37.34.png
Views:	160
Size:	61.1 KB
ID:	157667  
Tanjamuse is offline   Reply With Quote
Old 07-01-2017, 07:08 AM   #2300
cryzed
Evangelist
cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.
 
cryzed's Avatar
 
Posts: 408
Karma: 1050547
Join Date: Mar 2011
Device: Kindle Oasis 2
@JimmXinu, is there a way of backing up old versions of a story when updating it (fully)? Sometimes authors or sites decide that they want to remove an entire story or delete the chapter contents -- updating a story then will effectively delete the story from my library; I would like to prevent that.

If there's no obvious way to do it that I'm simply overlooking, I might try my hand at adding such an option.
cryzed is offline   Reply With Quote
Old 07-01-2017, 07:15 AM   #2301
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
That would be a good idea.
Tanjamuse is offline   Reply With Quote
Old 07-01-2017, 08:23 AM   #2302
cryzed
Evangelist
cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.
 
cryzed's Avatar
 
Posts: 408
Karma: 1050547
Join Date: Mar 2011
Device: Kindle Oasis 2
Hm, it's kind of hard to do since the file writing/updating for Calibre jobs seemingly works in a pretty complicated fashion -- workers get a target path that is supposed to be written to, but from that I don't think I can easily recreate the final path, so a custom backup path would have to be specified. However, even then, the file behind the outfilename that arrives in BaseStoryWriter.write_story() seems to be empty when the story is fully updated -- so one would have to change the code in all places where this method is called (3 places for the plugin).

Maybe Jimm can chime in with the best approach, I'm probably overlooking something obvious since I'm largely unfamiliar with the Calibre Plugin API.

Last edited by cryzed; 07-01-2017 at 08:31 AM.
cryzed is offline   Reply With Quote
Old 07-01-2017, 08:34 AM   #2303
cryzed
Evangelist
cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.
 
cryzed's Avatar
 
Posts: 408
Karma: 1050547
Join Date: Mar 2011
Device: Kindle Oasis 2
This is what I have so far (it's a fixed backup destination currently, which has to be changed). Unfortunately the resulting backup files are always empty -- which confuses me, because writeStory() uses the data presumably contained within to check if the EPUB should be updated in the first place? Or maybe it's only applicable to the CLI version and Calibre's Plugin API always creates an empty target file?
cryzed is offline   Reply With Quote
Old 07-02-2017, 05:18 AM   #2304
edeniz
Zealot
edeniz began at the beginning.
 
Posts: 132
Karma: 10
Join Date: Oct 2015
Device: Sony Reader, Tolino Shine, Samsung Galaxy S3
Quote:
Originally Posted by cryzed View Post
@JimmXinu, is there a way of backing up old versions of a story when updating it (fully)? Sometimes authors or sites decide that they want to remove an entire story or delete the chapter contents -- updating a story then will effectively delete the story from my library; I would like to prevent that.

If there's no obvious way to do it that I'm simply overlooking, I might try my hand at adding such an option.
If I may butt in, cryzed:

In my experience, when a story gets deleted or only some chapters get deleted, calibre plugin will skip the update automatically with the message that either the story does not exist or the story you're trying to download has fewer chapters than the file you already have. The sole requirement for that to happen is that you choose the option "update epub if new chapters" instead of "overwrite if newer" option.

Last edited by edeniz; 07-02-2017 at 05:21 AM.
edeniz is offline   Reply With Quote
Old 07-02-2017, 08:08 AM   #2305
cryzed
Evangelist
cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.cryzed ought to be getting tired of karma fortunes by now.
 
cryzed's Avatar
 
Posts: 408
Karma: 1050547
Join Date: Mar 2011
Device: Kindle Oasis 2
Hey edeniz, you aren't wrong, however that isn't a fool-proof solution. Regularly I overwrite the entire story, not just update it, since I read quite a few on sites where it is common to make changes to older chapters (rewrites etc.), and I'd like to keep them for the archive.
cryzed is offline   Reply With Quote
Old 07-02-2017, 08:39 AM   #2306
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by cryzed View Post
Hm, it's kind of hard to do since the file writing/updating for Calibre jobs seemingly works in a pretty complicated fashion -- workers get a target path that is supposed to be written to, but from that I don't think I can easily recreate the final path, so a custom backup path would have to be specified. However, even then, the file behind the outfilename that arrives in BaseStoryWriter.write_story() seems to be empty when the story is fully updated -- so one would have to change the code in all places where this method is called (3 places for the plugin).

Maybe Jimm can chime in with the best approach, I'm probably overlooking something obvious since I'm largely unfamiliar with the Calibre Plugin API.
That to me says you are taking the backup at the wrong time. The chapter gathering has already determined what has changed. From that, you should be able to do the backup before the download starts and access the original file.

But, calibre already has a backup method built in. It is probably possible to trigger the creation of the ORIGINAL_xxx that can be created when doing a conversion. Doing that has the advantage that calibre is expecting these files. And it is easy to restore them or use the editor to compare them.

And, the code to do this doesn't look hard. It is in gui2/tools.py, method convert_single_ebook. That does need access to the database, so it probably needs to be done before the download job is started.
davidfor is offline   Reply With Quote
Old 07-02-2017, 11:51 AM   #2307
edeniz
Zealot
edeniz began at the beginning.
 
Posts: 132
Karma: 10
Join Date: Oct 2015
Device: Sony Reader, Tolino Shine, Samsung Galaxy S3
Quote:
Originally Posted by cryzed View Post
Hey edeniz, you aren't wrong, however that isn't a fool-proof solution. Regularly I overwrite the entire story, not just update it, since I read quite a few on sites where it is common to make changes to older chapters (rewrites etc.), and I'd like to keep them for the archive.
Okay, thanks for the explanation, cryzed. Looking at things from that angle, then of course a rewrite makes sense, as well as wanting to find a way to protect the previous versions. I was confused and did not quite understand what you needed. Hope you can find a good solution, then.
edeniz is offline   Reply With Quote
Old 07-02-2017, 05:15 PM   #2308
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,328
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
New test version posted

2017-07-02
- Fix for XenForo(SB/SV) threadmarks with non-ascii chars. (web & CLI)

FYI, I have company for a few days, so my free time is a bit limited right now.

Re: Built-in backup, as edeniz said, the first line of defense is 'update epub if new chapters'. The second line of defense, IMO, is your own regular backups--everybody has those, right?

ORIGINAL_xxx as davidfor suggested is a possibility, but there are other things that also use that. So you might unknowingly overwrite your backup--maybe even automatically with auto-Convert. Another issue is that if you use certain tools like Polish on 'EPUB' and you also have an ORIGINAL_EPUB file, it will use the 'original' instead of the EPUB.

Copying the pre-update epub(assumed) to a different dir outside calibre entirely is possible, but not very elegant. Look at db.copy_format_to() (fff_plugin.py:1366) and add a second call there to copy to your backup dir (after you've figured out a file name, of course).

Other possibilities are to copy pre-update to another library, or maybe even define a new format extension to copy a backup to. (That would be in conflict with the 'Delete other formats' feature.)

I believe 'backups' have been requested before and I rejected the idea as outside scope and a bit of a slippery slope. If one backup, why not the last 2? Or 3? What about comparing to show what's changed between backup and current? Etc, etc.
JimmXinu is offline   Reply With Quote
Old 07-02-2017, 10:37 PM   #2309
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by JimmXinu View Post
Re: Built-in backup, as edeniz said, the first line of defense is 'update epub if new chapters'. The second line of defense, IMO, is your own regular backups--everybody has those, right?

ORIGINAL_xxx as davidfor suggested is a possibility, but there are other things that also use that. So you might unknowingly overwrite your backup--maybe even automatically with auto-Convert. Another issue is that if you use certain tools like Polish on 'EPUB' and you also have an ORIGINAL_EPUB file, it will use the 'original' instead of the EPUB.

Copying the pre-update epub(assumed) to a different dir outside calibre entirely is possible, but not very elegant. Look at db.copy_format_to() (fff_plugin.py:1366) and add a second call there to copy to your backup dir (after you've figured out a file name, of course).

Other possibilities are to copy pre-update to another library, or maybe even define a new format extension to copy a backup to. (That would be in conflict with the 'Delete other formats' feature.)

I believe 'backups' have been requested before and I rejected the idea as outside scope and a bit of a slippery slope. If one backup, why not the last 2? Or 3? What about comparing to show what's changed between backup and current? Etc, etc.
Yes, the backup is a slippery slope. With the ORIGINAL_xxx, I wasn't thinking of the other functions that might use this. I think I saw the backup as a safety feature and remove once you have checked the update is OK. And I'd forgotten about the Polish issues as the reason I knew where the code for this was was because I already had been fiddling with it to prevent use of the ORIGINAL_xxx in certain circumstances. (If I have an epub and an ORIGINAL_epub and do a conversion to kepub, which am I more likely to want to use?)

Of all the other choices, I'd be most tempted by adding another format such as "FFFBackup_xxx". The hassle with that is the thing I think I would most want to use it for is a comparison to the updated version. That would require a lot more changes than would be worthwhile.
davidfor is offline   Reply With Quote
Old 07-03-2017, 02:56 AM   #2310
madame_newbie
Connoisseur
madame_newbie began at the beginning.
 
madame_newbie's Avatar
 
Posts: 52
Karma: 48
Join Date: Mar 2017
Device: Kindle Basic 2014 | Kindle Paperwhite 3
Is the a way for me to bypass the 'Change Story URL' pop up. I am currently updating my identifiers and it's getting very tedious. I have looked in the .ini settings and can't find one that sets the answer to 'yes' automatically.
madame_newbie is offline   Reply With Quote
Reply

Tags
fanfiction


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 492 10-25-2022 08:13 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


All times are GMT -4. The time now is 10:19 AM.


MobileRead.com is a privately owned, operated and funded community.