Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-27-2021, 03:41 PM   #1
lrpirlet
Connoisseur
lrpirlet began at the beginning.
 
Posts: 96
Karma: 40
Join Date: Mar 2020
Location: Belgium (sorry, I am from the Walloon side of the country and I speak french only)
Device: PW3, Kobo Libra H2O
Question How to wipe out "series" field from within my metadata source plugin

I just can't find any topic that would explain how to wipe out the "series" field from within a metadata source plugin. Sorry if I did miss the information...

If vol_serie contains a value, then the old series field for this (title, authors) gets overwritten. This is what I want.
If vol_serie is set to "" then the old series field is not wiped out, leaving a "bad" information in the series field.

Code:
        mi = Metadata(vol_title, [vol_auteur])
        mi.set_identifier('nsfr_id', self.nsfr_id)
        mi.publisher = vol_editor
        mi.isbn = vol_isbn
        mi.tags = [vol_genre]
        mi.source_relevance = self.relevance
        mi.has_cover = bool(vol_cover_index)
        if vol_dp_lgl:
            mi.pubdate = vol_dp_lgl
        mi.series = vol_serie
        if vol_serie:
            mi.series_index = vol_serie_seq
        mi.language = "fra"

        mi.comments = vol_comment_soup

        if debug: self.log.info(self.who,"mi\n",mi,"\n")
        self.plugin.clean_downloaded_metadata(mi)

        self.result_queue.put(mi)
What kind of code should I write?
Is there an example somewhere in a metadata source plugin?

Thanks in advance.
lrpirlet is offline   Reply With Quote
Old 12-30-2021, 07:41 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC you cannot. Since the metadata download system assumes a null return form a plugin means data for that field was not found.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-30-2021, 03:08 PM   #3
lrpirlet
Connoisseur
lrpirlet began at the beginning.
 
Posts: 96
Karma: 40
Join Date: Mar 2020
Location: Belgium (sorry, I am from the Walloon side of the country and I speak french only)
Device: PW3, Kobo Libra H2O
Thanks Kovidgoyal, I was hopping for some better news, but that is ok :-)

Unless using some invisible characters such as "DEL", "NAK", "CAN", or a patern such as "DEL"*3, could be used to tell the system to force a wipeout...

However, I have not examined if that would be possible and/or if I would be able to patch calibre for that...

I guess the workaround to wipeout that field before invoking the metadata source plugin will become the rule...

Last edited by lrpirlet; 12-30-2021 at 03:13 PM.
lrpirlet is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In Edit Metadata, both "Number" field and "Next" button have letter N underlined. droopy Library Management 6 05-24-2020 03:46 AM
Adding a field to the "Review Downloaded Metadata" screen amyk0202 Library Management 4 04-22-2015 09:46 PM
Automatically populating metadata "tags" field from directory structure battaglia01 Calibre 1 12-13-2012 09:23 PM
Issue Editing MetaData in "Series" Field slammerkin Library Management 4 12-09-2012 01:33 AM
Bug? "Insert metadata as page at start of book" doesnt encode Comments field properly rollercoaster Calibre 2 04-24-2010 10:40 PM


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


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