Added more telemetry data for comics

This commit is contained in:
phil.borman@gmail.com 2026-01-19 23:03:44 +01:00
parent cc5155b62b
commit 5b9a7f0c61
6 changed files with 18 additions and 3 deletions

View File

@ -34,6 +34,7 @@ from lazylibrarian.formatter import (
plural,
strip_quotes,
)
from lazylibrarian.telemetry import TELEMETRY
def get_issue_num(words, skipped):
@ -115,6 +116,7 @@ def title_words(words):
def cv_identify(fname, best=True):
logger = logging.getLogger(__name__)
matchinglogger = logging.getLogger('special.matching')
TELEMETRY.record_usage_data('CV/Identify')
apikey = CONFIG['CV_APIKEY']
if not apikey:
# don't nag. Show warning message no more than every 20 mins
@ -412,6 +414,7 @@ def get_series_detail_from_search(page_content):
def cx_identify(fname, best=True):
logger = logging.getLogger(__name__)
matchinglogger = logging.getLogger('special.matching')
TELEMETRY.record_usage_data('CX/Identify')
res = []
fname = make_unicode(fname)
words = name_words(fname)

View File

@ -42,6 +42,7 @@ from lazylibrarian.providers import (
iterate_over_znab_sites,
)
from lazylibrarian.scheduling import SchedulerCommand, schedule_job
from lazylibrarian.telemetry import TELEMETRY
# '0': '', '1': '', '2': '', '3': '', '4': '', '5': '', '6': '', '7': '', '8': '', '9': '',
dictrepl = {'...': '', '.': ' ', ' & ': ' ', ' = ': ' ', '?': '', '$': 's', ' + ': ' ', '"': '',
@ -56,7 +57,7 @@ def search_item(comicid=None):
"""
logger = logging.getLogger(__name__)
results = []
TELEMETRY.record_usage_data('Search/Comic')
if not comicid:
return results
@ -211,6 +212,7 @@ def cron_search_comics():
def search_comics(comicid=None):
logger = logging.getLogger(__name__)
searchinglogger = logging.getLogger('special.searching')
TELEMETRY.record_usage_data('Search/Comics')
threadname = thread_name()
if "Thread" in threadname:
if not comicid:
@ -295,6 +297,7 @@ def search_comics(comicid=None):
def download_comiclist(foundissues):
logger = logging.getLogger(__name__)
loggesearching = logging.getLogger('special.searching')
TELEMETRY.record_usage_data('Download/Comiclist')
db = database.DBConnection()
try:
snatched = 0

View File

@ -30,7 +30,7 @@ BASE_DEFAULTS: list[ConfigItem] = [
ConfigURL('General', 'GR_URL', 'https://www.goodreads.com'),
ConfigURL('General', 'GB_URL', 'https://www.googleapis.com'),
ConfigURL('General', 'LT_URL', 'https://www.librarything.com'),
ConfigURL('General', 'CV_URL', 'https://www.comicvine.gamespot.com'),
ConfigURL('General', 'CV_URL', 'https://comicvine.gamespot.com'),
ConfigURL('General', 'CX_URL', 'https://www.comixology.com'),
ConfigBool('General', 'SHOW_NEWZ_PROV', 1),
ConfigBool('General', 'SHOW_TORZ_PROV', 1),

View File

@ -937,6 +937,7 @@ def create_mag_cover(issuefile=None, refresh=False, pagenum=1):
GS, GS_VER, generator = find_gs()
if GS_VER:
issuefile = issuefile.split('[')[0]
# could use "-sDEVICE=png16m" here instead?
params = [GS, "-sDEVICE=jpeg", "-dJPEGQ=100", "-dNOPAUSE", "-dBATCH", "-dSAFER",
f"-dFirstPage={check_int(pagenum, 1):d}",
f"-dLastPage={check_int(pagenum, 1):d}",

View File

@ -3341,6 +3341,7 @@ class WebInterface:
@require_auth()
def add_book(self, bookid=None, authorid=None, library=None):
self.check_permitted(lazylibrarian.perm_search)
TELEMETRY.record_usage_data()
if library == 'eBook':
ebook_status = "Wanted"
audio_status = "Skipped"
@ -3418,6 +3419,7 @@ class WebInterface:
@cherrypy.expose
@require_auth()
def search_for_book(self, bookid=None, library=None):
TELEMETRY.record_usage_data()
author_id = ''
db = database.DBConnection()
try:
@ -4977,6 +4979,7 @@ class WebInterface:
@require_auth()
def search_for_comic(self, comicid=None):
self.check_permitted(lazylibrarian.perm_search)
TELEMETRY.record_usage_data()
db = database.DBConnection()
try:
bookdata = db.match('SELECT * from comics WHERE ComicID=?', (comicid,))
@ -5135,6 +5138,7 @@ class WebInterface:
@require_auth()
def comic_scan(self, **kwargs):
self.check_permitted(lazylibrarian.perm_force)
TELEMETRY.record_usage_data()
logger = logging.getLogger(__name__)
comicid = kwargs.get('comicid')
@ -5336,6 +5340,7 @@ class WebInterface:
global comicresults
logger = logging.getLogger(__name__)
self.check_permitted(lazylibrarian.perm_search)
TELEMETRY.record_usage_data()
comicresults = []
if not title or title == 'None':
raise cherrypy.HTTPRedirect("comics")
@ -5380,6 +5385,7 @@ class WebInterface:
global comicresults
logger = logging.getLogger(__name__)
self.check_permitted(lazylibrarian.perm_comics)
TELEMETRY.record_usage_data()
apikey = CONFIG['CV_APIKEY']
if not comicid or comicid == 'None':
raise cherrypy.HTTPRedirect("comics")
@ -6821,6 +6827,7 @@ class WebInterface:
@require_auth()
def search_for_mag(self, bookid=None):
self.check_permitted(lazylibrarian.perm_search)
TELEMETRY.record_usage_data()
logger = logging.getLogger(__name__)
db = database.DBConnection()
bookdata = db.match('SELECT * from magazines WHERE Title=? COLLATE NOCASE', (bookid,))
@ -6851,6 +6858,7 @@ class WebInterface:
@require_auth()
def add_magazine(self, title=None, **kwargs):
self.check_permitted(lazylibrarian.perm_magazines)
TELEMETRY.record_usage_data()
logger = logging.getLogger(__name__)
if not title or title == 'None':
raise cherrypy.HTTPRedirect("magazines")

View File

@ -1,6 +1,6 @@
[GENERAL]
no_ipv6 = True
imp_preflang = English, en-GB, en, eng, en-US
imp_preflang = English, en, en-GB, en-US, eng
http_ext_timeout = 100
ebook_dir = ./testdata/eBooks
audio_dir = ./testdata/Audiobooks