Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 05-07-2013, 07:03 AM   #1366
Jade Aislin
Groupie
Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.
 
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
I've decided to redo the way my personal ini file handles tags I do not want to keep for AO3. It seems that every metadata section that I want (character, ships, genre) to grab from the site has a slew of tags that I do not want.

I had been listing the tags I didn't want and setting them blank, like this:


genre=>Until it isn't=>


However, this was making it hard to search the code. I was wondering if it were possible to set it so it would only apply if it did not match?

For example, say I have a genre 'Angst' and 'Adventure'. I would want it to keep those two tags, but not 'Until it isn't'.


genre!=>(Angst|Adventure)=>

I want the code to only erase the tag if it does not match anything in the parenthesis. ie 'Until it isn't' does not equal Angst or Adventure, so erase the tag.


I looked up the Regexp Tutorial and found how to negate a character, but I do not think that will work as it needed at least one character and I want to negate a whole string. Is there any way me to do this?
Jade Aislin is offline  
Old 05-07-2013, 02:11 PM   #1367
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,284
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Quote:
Originally Posted by Jade Aislin View Post
...
For example, say I have a genre 'Angst' and 'Adventure'. I would want it to keep those two tags, but not 'Until it isn't'.
...
Actually, we worked out a solution for that problem last week for another user over on the Google Group:

genre=>^.*?(|Angst|Adventure)$=>\1
JimmXinu is offline  
Advert
Old 05-09-2013, 12:08 PM   #1368
Saioko
Member
Saioko began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Apr 2013
Device: Digma s602
Is it possible to make FFDL to set "Date" column not as the day when story was downloaded, but with the date when the story was last updated?
In personal.ini it is only possible to change what will be added to title page, not what will go to which columns.
Saioko is offline  
Old 05-09-2013, 12:13 PM   #1369
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,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Saioko View Post
Is it possible to make FFDL to set "Date" column not as the day when story was downloaded, but with the date when the story was last updated?
In personal.ini it is only possible to change what will be added to title page, not what will go to which columns.
Calibres Date column is when Calibre FIRST make the record entry.
Pubdate would be a better choice for a new 'Edition'
theducks is offline  
Old 05-09-2013, 01:30 PM   #1370
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,284
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Quote:
Originally Posted by Saioko View Post
Is it possible to make FFDL to set "Date" column not as the day when story was downloaded, but with the date when the story was last updated?
No.

As theducks said, calibre sets the Date field in at least some cases. As I recall, I tried setting it to dateUpdated, but couldn't reliably.
Quote:
Originally Posted by theducks View Post
Calibres Date column is when Calibre FIRST make the record entry.
Pubdate would be a better choice for a new 'Edition'
The built-in Published(pubdate) field is populated with the Published date from the site--this is the date that the story was first created. I didn't (and don't) want to cause confusion by contradicting the terminology.

What I (and many other users) do is have a custom Updated date column(#updated) that I have FFDL populate from the Custom Columns tab of FFDL config. No personal.ini changes are needed.
JimmXinu is offline  
Advert
Old 05-09-2013, 01:46 PM   #1371
Saioko
Member
Saioko began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Apr 2013
Device: Digma s602
theducks, JimmXinu, thank you.
I already made that custom column, but I need that date in completely different place - when converting to fb2 - and I can't find a way to access that #updated column there. So I wanted to see if I can cheat that in your plugin somehow.
Saioko is offline  
Old 05-09-2013, 01:52 PM   #1372
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,284
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
I was going to suggest Metadata Plugboards or Find & Replace under 'Edit Metadata in Bulk', but it doesn't look like either of those can write to date. I don't have any other ideas.
JimmXinu is offline  
Old 05-09-2013, 02:30 PM   #1373
Jade Aislin
Groupie
Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.
 
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
I've almost got my personal ini set for Hobbit stories on AO3 when I ran into an output I didn't expect.

There are certain tags that I want at the end of a ship in parenthesis. However, I only want one per tag.

So instead of: Book/Comics.LOTR.Bilbo Baggins/Kíli (Friendship) (Family)

I want to break it down to:
Book/Comics.LOTR.Bilbo Baggins/Kíli (Friendship)

and

Book/Comics.LOTR.Bilbo Baggins/Kíli (Family)

I added code # 5 to seperate the tags out.

Spoiler:
Code:
 ##This only shows relevant code and key words have been edited to reduce space.

#1 convert & and 'and' to (Friendship) tag
 ships=> (&|and) (.*?)$=>/\2 (Friendship)
 ships=>&(.*?)$=>/\1 (Friendship) 
 ships=> (&|and) =>/
 ships=>&amp=>/
 
 #2 use key words to insert parenthesis tag
 ships=>(- brothers| - Family)=>\1 (Family)
 ships=>(Brotherly )(.*?)$=>\2 (Family)
 ships=>(- friendship|-Friendship)=>\1 (Friendship)
 ships=>(Platonic )(.*?)$=>\2 (Friendship)

 #3 Erase keywords
 ships=>(- brothers| - Family|Brotherly |- friendship|-Friendship|Platonic )=>
 
 #4 Make sure the parenthesis tag is at the end
 ships=>(\(Family\)|\(Friendship\))( )?(.*?)$=>\3 \1

 #5 Separate 2 parenthesis tags into different tags
 ships=>(.*?) \((.*?)\) \((.*?)\)=>\1 (\2), \1 (\3)

 #6 Sort Hierarchically.  Done after junk tags have been erased.
 ships=>(^Bilbo/)=>Book/Comics.LOTR.\1


However, when I did this, code # 6 only applied to the first one. So, I got:

Book/Comics.LOTR.Bilbo Baggins/Kíli (Friendship)

and

Bilbo Baggins/Kíli (Family)

The same thing happened if the two parenthesis were the same (like (Friendship) (Friendship)). I don't understand why the second tag is not going through the final step. Unless it doesn't seperate the commas into tags until the personal ini is finished. If so, is there a way I can fix this?

A couple urls that have this problem are:
http://archiveofourown.org/works/659182
http://archiveofourown.org/works/639...apters/1160141
Jade Aislin is offline  
Old 05-09-2013, 03:22 PM   #1374
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,284
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Quote:
Originally Posted by Jade Aislin View Post
I don't understand why the second tag is not going through the final step. Unless it doesn't seperate the commas into tags until the personal ini is finished. If so, is there a way I can fix this?
That's it exactly, actually.

FFDL keeps ships (etc) as a list of strings internally and applies metadata_replacements to each string separately.

You're changing one of those strings from:
"Baggins/Kíli (Friendship) (Family)" into "Baggins/Kíli (Friendship), Baggins/Kíli (Family)".

That part works because when FFDL hands it to calibre to put in a column, the list gets flattened into a comma separated string anyway.
["aa","ba, bb", "ca"] => "aa, ba, bb, ca"

(It's not practical for FFDL to split that new comma sep string into two list entries for you internally because commas can legitimately appear in the strings.)

For this particular problem, I think it's as simple as switching #5 & #6--do #6 then #5.
JimmXinu is offline  
Old 05-09-2013, 04:36 PM   #1375
Jade Aislin
Groupie
Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.
 
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
Quote:
Originally Posted by JimmXinu View Post

For this particular problem, I think it's as simple as switching #5 & #6--do #6 then #5.
That worked. I had some confusion because I had been able to do the same thing in the characters metadata without any problem. However, my code to add the 'Books/Comic' etc, to ships depends on the name being at the begining of the tag (^Bilbo). My character code just looks for the name anywhere in the tag.

So the ship:

Bilbo/Kili (Friendship), Bilbo/Kili (Family)

returned:

Books.Bilbo/Kili (Friendship)
Bilbo/Kili (Family)

while the character:

Bilbo, Kili

returned:

Book.Bilbo
Book.Kili

Thanks again.
Jade Aislin is offline  
Old 05-09-2013, 05:34 PM   #1376
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,284
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Quote:
Originally Posted by Jade Aislin View Post
That worked. I had some confusion because I had been able to do the same thing in the characters metadata without any problem. However, my code to add the 'Books/Comic' etc, to ships depends on the name being at the begining of the tag (^Bilbo). My character code just looks for the name anywhere in the tag.
That makes sense. The regex matches in the same string more than once then.

Once you've got this all working to your satisfaction, if you'd be willing to share it, I'd be interested in posting on the project wiki as an example for others.
JimmXinu is offline  
Old 05-10-2013, 12:02 PM   #1377
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,284
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
FYI, while searching for existing stories to update, FFDL ignores the current Virtual Library setting.

At this time, I don't have any plans to change that.
JimmXinu is offline  
Old 05-11-2013, 04:12 PM   #1378
Jade Aislin
Groupie
Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.
 
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
Quote:
Originally Posted by JimmXinu View Post
Once you've got this all working to your satisfaction, if you'd be willing to share it, I'd be interested in posting on the project wiki as an example for others.
I can do that. I've almost got it how I want it.

However, it occurred to me that I might have problems if the character or ship contained parenthesis. So I'm trying to figure out what I want to change it to. For example there is a character that I renamed as Gollum (Smeagol) as the character has two valid names.

The only symbols I can think to use aside from ( ) are [ ], { }, < >. I know that [ ] has special meaning in Python. But does either { } or < > have any special meaning in Python?
Jade Aislin is offline  
Old 05-11-2013, 05:07 PM   #1379
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,284
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
@Jade Aislin - Without experimenting, I don't really know. You'll have to try each to see. FYI, for < > you should use &lt; &gt; Otherwise it wouldn't show up correctly inside the epub/html/etc. I expect that one may be best.

That does give me an idea for a new FFDL feature, though. I've always had the test1.com adapter that returns dummy stories for testing output and metadata process testing. I could make maybe that configurable so you could set the title, author(s), ships, characters, etc, etc for a test story URL to try out different things without hitting real servers over and over.
JimmXinu is offline  
Old 05-11-2013, 06:11 PM   #1380
Jade Aislin
Groupie
Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.
 
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
Quote:
Originally Posted by JimmXinu View Post
@Jade Aislin - Without experimenting, I don't really know. You'll have to try each to see. FYI, for < > you should use &lt; &gt; Otherwise it wouldn't show up correctly inside the epub/html/etc. I expect that one may be best.
I didn't have a problem with < >. When I checked the different symbols using notpad ++ with Python language, the { } lit up the same way that ( ). So, I think the brackets may have some meaning in Python. The < > did not light up, so I used those.

I tried it on one of the ships that contains a name with the < >. It went from: implied Sam/Frodo=>Sam <Samwise Gamgee>/Frodo Baggins=>Frodo Baggins/Sam <Samwise Gamgee> with no problem. It doesn't seem like the &lt; is needed, but I could be wrong.

Quote:
Originally Posted by JimmXinu View Post
That does give me an idea for a new FFDL feature, though. I've always had the test1.com adapter that returns dummy stories for testing output and metadata process testing. I could make maybe that configurable so you could set the title, author(s), ships, characters, etc, etc for a test story URL to try out different things without hitting real servers over and over.
That would be great. I've always had trouble using the test dummy. I've mostly used it to find errors in my code that won't let it run rather than making sure that the output is correct. I would have to sort through the examples that are in the file already before I could figure out what I trying to test. There's been I few times I started writing replacement code for some of the examples in the test file. If I could input what I'd get from the actual site easily, it would be easier to figure out how to get the output I want.
Jade Aislin is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Resize Cover kiwidude Plugins 95 03-16-2024 11:55 PM
[GUI Plugin] Open With kiwidude Plugins 402 03-16-2024 11:44 PM
[GUI Plugin] Find Duplicates kiwidude Plugins 1096 03-16-2024 11:28 PM
[GUI Plugin] Count Pages kiwidude Plugins 1744 03-02-2024 05: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 06:04 AM.


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