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 11-07-2024, 11:02 PM   #10081
XRoverMaelstromX
Junior Member
XRoverMaelstromX began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jun 2021
Device: MoonReader+ (Android App)
Welp, that worked for the duplication in the tag, thank you! Fun fact, I tested to see if the dash was the issue, and changing the replacement phrase to Status.Completed resulted in Status.Status.Completed, and I'm seriously curious as to why not having the anchors defining the beginning and ends of the string resulted in that kind of duplication!

Do you, or anyone, know how to make it do the replacement only for where it's dropping the status into the tags but not on the title page? I can live with it being slightly awkward on the title page, but I'd prefer it not to be.
XRoverMaelstromX is offline   Reply With Quote
Old 11-08-2024, 12:25 PM   #10082
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: 7,212
Karma: 5006097
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
The duplication is an odd interaction between how FFF treats list vs scalar(single) metadata entries with regard to replace_metata and how the method to get subject tags explicitly calls for lists.

Using ^ and $ anchors just means the regex doesn't match the 'Status - ' version when it comes by again.

This is a bug. Hopefully I'll be able to come up with a proper fix.

Yes, it's possible to change only the tags version by making a copy of status to modify and include in subject tags. In fact, if you'd done that first, I don't think this bug would have been revealed.

Search for include_in_ and add_to_extra_valid_entries if you don't want to wait while I'm bug hunting.
JimmXinu is offline   Reply With Quote
Old 11-08-2024, 12:43 PM   #10083
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: 7,212
Karma: 5006097
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
New Test Version Posted

2024-11-08
- Add subject_tags to -m/j CLI output
- Fix for double replace_metadata when non-list metadata called by getList().

Test version should address XRoverMaelstromX's duplication issue.

Quote:
Originally Posted by XRoverMaelstromX View Post
I am trying to change how FanFicFare phrases the status metadata piece when it puts it into tags. I used replace metadata and it came out very weird and I don't understand why.
I would further suggest:
Code:
# make a copy of status
add_to_extra_valid_entries:,headerstatus
include_in_headerstatus:status

# add 'Status - ' to all possible status values--some sites do have more
# but only on copy
replace_metadata:
 headerstatus=>^=>Status -\s

# use headerstatus in subject tags only.
include_subject_tags: headerstatus, extratags
JimmXinu is offline   Reply With Quote
Old 11-12-2024, 10:28 PM   #10084
MsFlutter
Member
MsFlutter began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2023
Device: Android 12 phone
Sorry if this is a common question, but do you have any plans to enable editing the calibre library from the command line? It's mentioned in the top post, but I wasn't sure if it was something you were working on, or if it's just been fully shelved until further notice.

I've been interested in making a script of some kind to make importing fics easier when I'm not at home. I could in theory download the fics and then import them, but I rely pretty heavily on Calibre's columns so I'd probably end up just having to update the metadata manually anyway.
MsFlutter is offline   Reply With Quote
Old 11-13-2024, 10:17 AM   #10085
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: 7,212
Karma: 5006097
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Not really.

In theory, it's possible. But it would require re-implementing everything the plugin does using Calibre's CLI interface.

Plus the FFF plugin have several features that need to pop dialogs to the user and/or call other plugins.
JimmXinu is offline   Reply With Quote
Old 11-14-2024, 02:29 AM   #10086
XRoverMaelstromX
Junior Member
XRoverMaelstromX began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jun 2021
Device: MoonReader+ (Android App)
Thanks for the bugfix! I really appreciate the help there!

I have another question - I searched the thread and I think this isn't possible, but I'm unsure so I wanted to check in case it has become possible. I have my personal.ini set up to grab my subscription status and it works perfectly for single stories, but for anthologies made from series URLs it returns the subscription status for all the stories in the series and not the series itself. Is there a way to pull the subscribed status for the series instead? I know this was mentioned earlier in the thread as not being possible, but I also know that the Status metadata is pulled from the series instead of the individual fics within it for that yes/no column, so I was hoping that whatever the issue before was has been fixed (or is possible to fix) with the newer updates. Thanks!
XRoverMaelstromX is offline   Reply With Quote
Old 11-14-2024, 10:24 AM   #10087
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: 7,212
Karma: 5006097
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
There's special code in the plugin for anthology status, and it's honestly a bit of a kludge.

I don't really want to also add special code for site specific metadata like subscribed.
JimmXinu is offline   Reply With Quote
Old 11-14-2024, 07:34 PM   #10088
XRoverMaelstromX
Junior Member
XRoverMaelstromX began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jun 2021
Device: MoonReader+ (Android App)
Quote:
Originally Posted by JimmXinu View Post
There's special code in the plugin for anthology status, and it's honestly a bit of a kludge.

I don't really want to also add special code for site specific metadata like subscribed.
That's totally fair! Thanks for doing all you have with this so far!
XRoverMaelstromX is offline   Reply With Quote
Old 11-16-2024, 06:37 PM   #10089
John Maverick
Connoisseur
John Maverick began at the beginning.
 
Posts: 61
Karma: 10
Join Date: Oct 2018
Device: none
FFF can't open site page in browser when open_pages_in_browser:true

A month ago I upgrade the OS of my linux PC. Since then open_pages_in_browser isn't working.

Maybe some library was lost in the upgrade or something?

Since the OS upgrade I have updated Calibre and FFF hoping that the problem would solve, but that didn't change anything.

My setup is the following:
OS: Linux Mint 22.0 x86_64 (Upgraded from 21.3)
Calibre version: 7.21 (Official install from Calibre website, not the distro repository)
FanFicFare version: v4.40.0

I attached in this post the debug log of Calibre ten FFF try to open the browser and my safe personal.ini

Somebody has an idea of what is happening?

Like always thanks in advance.
Attached Files
File Type: txt calibre_debug_log_of_open_pages_in_browser_failing.txt (12.9 KB, 96 views)
File Type: txt safe_personal.ini__2024-11-16.txt (15.2 KB, 102 views)
John Maverick is offline   Reply With Quote
Old 11-16-2024, 06:45 PM   #10090
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: 7,212
Karma: 5006097
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by John Maverick View Post
A month ago I upgrade the OS of my linux PC. Since then open_pages_in_browser isn't working.

Maybe some library was lost in the upgrade or something?

Since the OS upgrade I have updated Calibre and FFF hoping that the problem would solve, but that didn't change anything.
The page doesn't open in your browser? Does it work to click a story (or other) link in Calibre and have it open in browser?

As I recall, FFF uses the same code to open a web page in browser that Calibre does, except in a background process.

Or the page opens, but the cache lookup fails? That would suggest the browser cache location setting in FFF may be wrong now. IE, your browser cache lives in a different place, or you're using a different browser now.
JimmXinu is offline   Reply With Quote
Old 11-16-2024, 07:07 PM   #10091
John Maverick
Connoisseur
John Maverick began at the beginning.
 
Posts: 61
Karma: 10
Join Date: Oct 2018
Device: none
Quote:
Originally Posted by JimmXinu View Post
The page doesn't open in your browser?
Yes. FFF Seems to try opening the page in the default browser of the OS, but nothings happens

Quote:
Originally Posted by JimmXinu View Post
Does it work to click a story (or other) link in Calibre and have it open in browser?
Yes, it works from Calibre. If click in the story id in Calibre the page of the story is opened in the Browser. It works with the default browser or choosing an specific browser from the setting "openers_by_scheme". Like this:
Code:
# Cambiar los programas que se ejecutan al abrir archivos o URL

openers_by_scheme = {'http*': 'firefox %u'}
Quote:
Originally Posted by JimmXinu View Post
Or the page opens, but the cache lookup fails? That would suggest the browser cache location setting in FFF may be wrong now. IE, your browser cache lives in a different place, or you're using a different browser now.
The page are never opened. But FFF can read the Browser cache. I have to open the stories chapters in the browser like before "open_pages_in_browser" was implemented to update or download stories.

If it helps the default browser of the OS is Chromium. Switching it for Firefox does the same. And trying to open urls from other programs like the text editor or even the command line works fine.

Last edited by John Maverick; 11-16-2024 at 08:24 PM. Reason: Some corrections.
John Maverick is offline   Reply With Quote
Old 11-16-2024, 09:47 PM   #10092
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: 7,212
Karma: 5006097
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by John Maverick View Post
Yes. FFF Seems to try opening the page in the default browser of the OS, but nothings happens
...
Yes, it works from Calibre. If click in the story id in Calibre the page of the story is opened in the Browser. It works with the default browser or choosing an specific browser from the setting "openers_by_scheme".
I did not recall correctly.

FFF imports webbrowser from python's standard lib and calls open(). Calibre jumps through a bunch of Qt hoops to call QDesktopServices.openUrl(qurl) OR runs a subprocess to call CLI program xdg-open.

I assume that something in your OS update either broke or 'secured' python's webbrowser as called from FFF.

Are you sufficiently python savvy to try testing it with a basic script? Or investigating if it's a per-program security thing?

Anyone else see this? I'm not real thrilled with the idea of adding a whole subprocess forking, but I could consider it if this is going to be a common problem.
JimmXinu is offline   Reply With Quote
Old 11-17-2024, 01:36 AM   #10093
John Maverick
Connoisseur
John Maverick began at the beginning.
 
Posts: 61
Karma: 10
Join Date: Oct 2018
Device: none
Quote:
Originally Posted by JimmXinu View Post
Are you sufficiently python savvy to try testing it with a basic script? Or investigating if it's a per-program security thing?
While I'm a programmer, I never used python.

For whatever is worth, running this in the command line open the browser:

Code:
python3 -m webbrowser -t "https://www.python.org"
But Calibre comes with it's own python installed, right?

I also tried to run the following python script with calibre-debug to see what happens:

Code:
import webbrowser

url="https://www.python.org"

print('Trying opening this url: '+url)
webbrowser.open(url)
The browser isn't opened, only the print is shown. But I don't know if the issue here is what it's happening with FFF, or something that is wrong in my script.

Last edited by John Maverick; 11-17-2024 at 01:41 AM.
John Maverick is offline   Reply With Quote
Old 11-17-2024, 11:30 AM   #10094
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: 7,212
Karma: 5006097
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
New Test Version Posted

2024-11-17
- Call Calibre's safe_open_url for open_pages_in_browser


Perfect--that's exactly the sort of testing I meant.

This shows that it's something to do with running from Calibre's python, not python in general or FFF specifically.

Give this test version a try.

I blame general 'I'm tired' reasons for not realizing yesterday that I don't need to duplicate Calibre's code, I can just call it.
JimmXinu is offline   Reply With Quote
Old 11-17-2024, 01:49 PM   #10095
John Maverick
Connoisseur
John Maverick began at the beginning.
 
Posts: 61
Karma: 10
Join Date: Oct 2018
Device: none
Quote:
Originally Posted by JimmXinu View Post
New Test Version Posted

2024-11-17
- Call Calibre's safe_open_url for open_pages_in_browser
Quote:
Originally Posted by JimmXinu View Post
Give this test version a try.
Now it's working perfectly. Actually it works even better than before the bug because now I can use a different browser to open the pages than the default of the OS. By choosing the browser that Calibre use in the settings, that it's used to open the pages by FFF. I preffer to have a browser that I only use for FFF

Quote:
Originally Posted by JimmXinu View Post
I blame general 'I'm tired' reasons for not realizing yesterday that I don't need to duplicate Calibre's code, I can just call it.
It can happen to the best of us. Again, thanks for your help and fast response
John Maverick is offline   Reply With Quote
Reply

Tags
fanfiction


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 527 08-15-2025 02:36 PM
[GUI Plugin] Open With kiwidude Plugins 404 02-21-2025 06:42 AM
[GUI Plugin] Marvin XD Philantrop Plugins 126 01-29-2017 01:48 PM
[GUI Plugin] KiNotes -axel- Plugins 0 07-14-2013 07:39 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 01:08 AM.


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