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 01-11-2020, 01:50 AM   #556
Marco77
Connoisseur
Marco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipse
 
Posts: 55
Karma: 8430
Join Date: Mar 2016
Device: PW3, Clara HD, PB740
Lightbulb Function to retrieve timestamp from filesystem

Hello there,

Thank you for this PI, I've used it sporadically a few years ago and it was useful.

I believe my whole library was modified by adding a custom column recently, and since my default view is sorted by last modified, the ordering is in complete shambles.

Cue Job Spy, but ofc I don't have a backup of those timestamps, furthermore copying from "added time" yields a bit unsatisfactory results, with quite a few empty fields.

So... long story short, I patched the code to add a new function. It retrieves the timestamp from filesystem, assuming it will be authoritative.

- It takes the most recent timestamp found amongst available formats; no action is taken if no file was found
- the file path is computed using "self.guidb.format_abspath" but I left over the libpath path construction code, you might want to clean this up by choosing whichever preferred way
- all queries are wrapped in a single transaction, so it's do-or-die
- apsw cannot prepare queries using datetime objects? Had to manually force the str() conversion. It seems fine when browsing using sqlite3
Attached Files
File Type: zip ui-py.zip (2.0 KB, 156 views)
Marco77 is offline   Reply With Quote
Old 01-12-2020, 10:24 AM   #557
Nekrodamus
Member
Nekrodamus began at the beginning.
 
Nekrodamus's Avatar
 
Posts: 10
Karma: 10
Join Date: Jan 2020
Device: Kobo Aura H2O
Problems with Copy User Category from Source Library to Target Library

Hi Dalton

I usually use the Utility GUI Tool "Copy User Category from Source Library to Target Library", until version 1.0.167 I had no problems, but in version 1.0.170 it doesn't work, at least to me, all the tests I did using Caliber 4.8. I attached some images so you can see what happens. Tell me if you need other data.

Apart from this matter, could an option to copy all categories at once be added to this utility, in the future, so as not to have to copy one by one. This would be wonderful.

On the other hand, thank you very much for such an excellent plugin, it is really very useful.

Regards!!!

PD: Google English, sorry !!
Attached Thumbnails
Click image for larger version

Name:	167.jpg
Views:	157
Size:	12.1 KB
ID:	176364   Click image for larger version

Name:	170-1.jpg
Views:	159
Size:	5.0 KB
ID:	176365   Click image for larger version

Name:	170-2.jpg
Views:	149
Size:	47.7 KB
ID:	176366  
Nekrodamus is offline   Reply With Quote
Old 01-12-2020, 01:02 PM   #558
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
My JS test categories had no diacritics, such as Spanish accents. Hence, I did not encounter any copy-category testing issues caused by changing JS to be compatible with Calibre 4.99+ that uses Python 3. My fault. I will add some diacritics to a test user category, fix it, and upload the new version of JS later today.

Thanks for "testing" the new version.


DaltonST
DaltonST is offline   Reply With Quote
Old 01-12-2020, 04:30 PM   #559
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Version 1.0.171 Technical changes after Python 3.8 testing with Calibre 4.99.3

Version 1.0.171 -2020-01-12 Technical changes after Python 3.8 testing with Calibre 4.99.3

The "Copy User Category to another Library" GUI Tool uses JSON, which changed just enough recently to unintentionally cause a copied UC to be "renamed" into garbage characters if the original name had non-English characters. The copy worked fine, but the UC name was garbled. Fixed.

Tested in both Calibre 4.8 and Calibre 4.99.3


DaltonST
DaltonST is offline   Reply With Quote
Old 01-13-2020, 01:16 PM   #560
Nekrodamus
Member
Nekrodamus began at the beginning.
 
Nekrodamus's Avatar
 
Posts: 10
Karma: 10
Join Date: Jan 2020
Device: Kobo Aura H2O
Thanks dalton

I tried this new version and it works perfect !!!

Regards!
Nekrodamus is offline   Reply With Quote
Old 01-13-2020, 08:37 PM   #561
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 1,156
Karma: 1900479
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
Hi,

I noticed that a few updates ago the plugin required the newest version of Calibre, however I still run a Windows 7 machine and apparently they stopped supporting Windows 7. I plan on keeping Windows 7, but if I end up having to stay with an older version of Calibre, will your plugin be available?
Rellwood is offline   Reply With Quote
Old 01-14-2020, 10:00 AM   #562
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Quote:
Originally Posted by Rellwood View Post
Hi,

I noticed that a few updates ago the plugin required the newest version of Calibre, however I still run a Windows 7 machine and apparently they stopped supporting Windows 7. I plan on keeping Windows 7, but if I end up having to stay with an older version of Calibre, will your plugin be available?
I don't really understand the "I plan on keeping Windows 7, but if I end up having to stay with an older version of Calibre".

I upgraded to Windows 10 as soon as it first came out, and was immediately rewarded with a noticeably snappier machine since Microsoft modularized its functions to optimize its active memory footprint viz a viz Windows 7.

If you are concerned with running old versions of Calibre with old versions of your plugins, "best practices" would say that you should periodically be backing up your "C:\Users\Rellowood\AppData\Roaming\calibre\plugin s" directory into a date-stamped directory name (to avoid overwriting) on an external drive so that you will have all of your old plugins (and their associated preferences .JSON files) in discrete locations for future use if you have to install old versions that are all guaranteed compatible with the version of Calibre in-use at the time of the back up. You might want to download the Calibre version in use at that same time, and move it to the same external drive.

Calibre, its plugins, and the plugins' .JSON files are matched sets that work properly together at any point in time.

I assume that you already know that you can install old versions of Calibre Portable directly onto your hard-drive in specifically named directories, and run each version independently of the others. Just make sure the \calibre\config\ directory is properly seeded for each. Keeping your plugin preferences .JSON files across Calibre versions synchronized could be an issue unless you standardize on a single "old version" to use consistently.

Just my personal opinion, but the above sounds like a lot of needless aggravation just to keep Windows 7.

To finally answer your original question, JS uses Calibre's own application-specific libraries for many purposes, so as Calibre changes, JS has to change with it or one or more of its 62 tools (or even all of JS) will fail and die. Hence, as Calibre changes, the minimum JS version likely will have to increase as well. If you do not upgrade Calibre, then you would be "stuck" on the JS version active at that time. Just be sure to keep a discretely-named backup of the "stuck on" JS .zip file since it could easily be overwritten by a newer file with the identical name. Hence, the advice given previously.



DaltonST
DaltonST is offline   Reply With Quote
Old 01-18-2020, 05:03 PM   #563
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 1,156
Karma: 1900479
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
Thanks for letting me know.

Question, do you have problems with creating restore points and using previous versions of files? I was under the impressions (after trying Windows 10 many times) that you needed an external drive always connected to your computer to enable that feature.

This was why I stayed with Windows 7. I noticed that restore points and previuos versions of files weren't being made unless the external drive was connected.
Rellwood is offline   Reply With Quote
Old 01-18-2020, 06:00 PM   #564
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
File History and Restore points are different beasts.

RP is for OS changes and usually fires off on any program install the invokes UAC

OTOH File History is a safety net, and wants to keep files elsewhere.
You can change that place, as long as it is external
Attached Thumbnails
Click image for larger version

Name:	File History.JPG
Views:	181
Size:	46.7 KB
ID:	176530  
theducks is offline   Reply With Quote
Old 01-20-2020, 07:25 AM   #565
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
If you have this tool already, then I apologize, I couldn't find it.

Could you add a tool where it's possible to copy info from a custom column in 1 book? Ideally I would love to have an option too where I can then add it to a different book.
Tanjamuse is offline   Reply With Quote
Old 01-20-2020, 09:35 AM   #566
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Calibre already does that.
DaltonST is offline   Reply With Quote
Old 01-23-2020, 02:23 AM   #567
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
When I add this

Code:
{:'re(re(field("#fandoms"),":"," "),"§","&")'}/{#story_id}/{#story_id}
to the Tweak for Per-Library: 'Save-to Template': Default Template it says:

calibre, version 4.8.0
ERROR: JS+ GUI Tool: Save-To Template is Invalid. Reset to Calibre Default Template.
Tanjamuse is offline   Reply With Quote
Old 01-23-2020, 10:00 AM   #568
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by Tanjamuse View Post
When I add this

Code:
{:'re(re(field("#fandoms"),":"," "),"§","&")'}/{#story_id}/{#story_id}
to the Tweak for Per-Library: 'Save-to Template': Default Template it says:

calibre, version 4.8.0
ERROR: JS+ GUI Tool: Save-To Template is Invalid. Reset to Calibre Default Template.
You could try:
Code:
{#fandoms:'re(re($,":"," "),"§","&")'}/{#story_id}/{#story_id}
ilovejedd is offline   Reply With Quote
Old 01-23-2020, 10:01 AM   #569
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Version 1.0.172 - Allow Quotes in Tweak Default

Version 1.0.172 -2020-01-23 Allow single and double quotes in the tweak default for save-to template.



DaltonST
DaltonST is offline   Reply With Quote
Old 01-30-2020, 12:27 PM   #570
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
Multi-Reply:

Sorry, I haven't had time to test it before now.

Quote:
Originally Posted by ilovejedd View Post
You could try:
Code:
{#fandoms:'re(re($,":"," "),"§","&")'}/{#story_id}/{#story_id}
It didn't change the § to & when it was saved, but it's okay, because with the following changes DaltonST made to the plugin my original template works.

Quote:
Originally Posted by DaltonST View Post
Version 1.0.172 -2020-01-23 Allow single and double quotes in the tweak default for save-to template.

DaltonST
Thanks so much both of you.
Tanjamuse is offline   Reply With Quote
Reply

Tags
author aka, author pen name, colors, toolbag, toolbox, tools


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 492 10-25-2022 08:13 AM
[GUI Plugin] Ex Libris AlPe Plugins 87 10-10-2020 03:10 PM
[GUI Plugin] Marvin XD Philantrop Plugins 126 01-29-2017 12:48 PM
Ubuntu/Linux : Command to schedule a job with Calibre.( No GUI ) DurgaPrasad Calibre 0 10-16-2013 06:50 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 12:44 PM.


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