Replacing 'director' by 'author' on video or movie types when exporting with Better BibLaTeX

edited March 16, 2018
I'm trying to figure out how this has to be done, but I fail in someway. So, because of that, I just tried to add the author field catching director.

I think it is such an easy postscript like this:

if (Translator.BetterBibLaTeX && this.item.itemType === 'video') {
this.add({ name: 'author', value: this.item.director })
}

It does not work. I tried this:

if (Translator.BetterBibLaTeX && this.item.itemType === 'video') {
this.add({ name: 'author', value: this.item.director })
this.add({ name: 'platform', value:'test'})
}

Then "debugging" if the conditional was running. Platform field isn't in the exported results neither.

Maybe 'video' is not the type word?

PS: is not working with 'film' type neither, by the way.
=(
  • The item types are film and videoRecording respectively (see https://aurimasv.github.io/z2csl/typeMap.xml) but I'm confused which code exactly you're editing?
  • I'm adding these lines to Better BibLaTeX postscript code. Now, 'platform: test' is being writing, so it recognizes the type. But 'author' is not adding with 'director' values.
  • I don't know exactly how the code is set up for BBT, but creator types are stored in a more complex format in Zotero: all creators are stored* in an array of objects, where the creatorType is one of the object properties. See the example here:
    https://github.com/zotero/translators/blob/master/IMDb.js#L155
    You'd probably have to account for that in your postscript.

    * to be quite precise that's not how they're stored (they're in an sqlite table), but that's how they're represented by the internal API, which is all that's relevant here
  • edited March 16, 2018
    Hmmm... Interesting. I tried again now knowing that, but still not working.
    I will write here if I get something.

    Thanks so much!
  • It's being handled on the BBT issue tracker.
Sign In or Register to comment.