Skip to content

Commit

Permalink
remove logging
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Sep 20, 2024
1 parent da90faa commit daceefe
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions content/better-bibtex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,15 @@ $Patcher$.schedule(Zotero.API, 'getResultsFromParams', original => function Zote
try {
if (params.itemKey) {
const libraryID = params.libraryID || Zotero.Libraries.userLibraryID
log.debug('2992: getResultsFromParams pre', { itemKey: params.itemKey })
params.itemKey = params.itemKey.map((itemKey: string) => {
const m = itemKey.match(/^(bbt:|@)(.+)/)
if (!m) return itemKey
const citekey = Zotero.BetterBibTeX.KeyManager.first({ where: { libraryID, citationKey: m[2] }})
return citekey?.itemKey || itemKey
})
log.debug('2992: getResultsFromParams post', { itemKey: params.itemKey })
}
}
catch (err) {
log.debug('2992: getResultsFromParams', params, err)
log.error('getResultsFromParams', params, err)
}

Expand All @@ -244,15 +241,13 @@ $Patcher$.schedule(Zotero.API, 'getResultsFromParams', original => function Zote
if (typeof Zotero.DataObjects.prototype.parseLibraryKeyHash === 'function') {
$Patcher$.schedule(Zotero.DataObjects.prototype, 'parseLibraryKeyHash', original => function Zotero_DataObjects_prototype_parseLibraryKeyHash(libraryKey: string) {
const item = parseLibraryKeyFromCitekey(libraryKey)
log.debug('2992: parseLibraryKeyHash', libraryKey, '=>', { item })
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return typeof item === 'undefined' ? original.apply(this, arguments) : item
})
}
if (typeof Zotero.DataObjects.prototype.parseLibraryKey === 'function') {
$Patcher$.schedule(Zotero.DataObjects.prototype, 'parseLibraryKey', original => function Zotero_DataObjects_prototype_parseLibraryKey(libraryKey: string) {
const item = parseLibraryKeyFromCitekey(libraryKey)
log.debug('2992: parseLibraryKey', libraryKey, '=>', { item })
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return typeof item === 'undefined' ? original.apply(this, arguments) : item
})
Expand Down Expand Up @@ -453,14 +448,12 @@ $Patcher$.schedule(Zotero.Translate.Export.prototype, 'translate', original => f
// requested translator
const translator = Translators.byId[translatorID]
if (this.noWait || !translator) {
log.debug('2981: stock translator:', { translator: this.translator, displayOptions: this._displayOptions })
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return original.apply(this, arguments)
}

const displayOptions = this._displayOptions || {}

log.debug('2981: BBT translator:', translator)
if (this.location) {
if (displayOptions.exportFileData) { // when exporting file data, the user was asked to pick a directory rather than a file
displayOptions.exportDir = this.location.path
Expand Down

0 comments on commit daceefe

Please sign in to comment.