Commit Graph

41 Commits

Author SHA1 Message Date
Timmy Welch
bf2b4ab268 Rename check_api_key to check_status
Parameter is changed to a settings dict so that a Talker can retrieve any info it needs
Change issue_id type annotation to str
2023-09-06 02:59:59 -04:00
Timmy Welch
f72ebdb149 Simplify ComicCacher to store a single binary data field and ID(s)
If the ComicCacher is to be a generic cache for talkers it must assume
 very little. Current assumptions:
 - There are issues that can be queried individually by an "Issue ID" and they have a relation to a single series
 - There are series that can be queried individually by an "Series ID" and they have a relation to zero or more issues
 - There are Searches that can be queried by the search term and they have a relation to zero or more series

Each series and issue have a boolean `complete` attribute which is up to the talker to decide what it means.
Data is returned as a tuple ([series, complete] or [issue, complete]) or a list of tuples
An issue consists of an ID, an series ID and a binary data attribute which is up to the talker to determine what it means.
An series consists of in ID and a binary data attribute which is up to the talker to determine what it means.

The data attribute is binary to allow for compression and efficient storage of binary data (e.g. pickle) it is suggested to store it as json or similar text format encoded with utf-8. If the talker is using a website API it is suggested to store the raw response from the server.

All caches automatically expire 7 days after insertion.
2023-08-05 03:02:12 -07:00
Timmy Welch
2c3a2566cc Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
 it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
  series_id:        a string uniquely identifying the series to tag_origin
  series_aliases:   alternate series names that are not the canonical name
  title_aliases:    alternate issue titles that are not the canonical name
  alternate_images: a list of urls to alternate cover images

Updated attributes for GenericMetadata:
  genre        -> genres:        str -> list[str]
  comments     -> description:   str -> str
  story_arc    -> story_arcs:    str -> list[str]
  series_group -> series_groups: str -> list[str]
  character    -> characters:    str -> list[str]
  team         -> teams:         str -> list[str]
  location     -> locations:     str -> list[str]
  tag_origin   -> tag_origin:    str -> TagOrigin (tuple[str, str])

ComicSeries has been relocated to the ComicAPI package, currently has no
 usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
 ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
 in the GUI when a series is selected and does not already contain the
 needed fields, this function should always be cached.

A new split function has been added to ComicAPI, all uses of split on
 single characters have been updated to use this

cleanup_html and the corresponding setting are now only used in
 ComicTagger proper, for display we want any html directly from the
 upstream. When applying the metadata we then strip the description of
 any html.

A new conversion has been added to the MetadataFormatter:
  j: joins any lists into a string with ', '. Note this is a valid
     operation on strings as well, it will add ', ' in between every
     character.

parse_settings now assigns the given ComicTaggerPaths object to the
 result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
Timmy Welch
4151c0e113 Cleanup sqlite
Remove the import rename
use sqlite3.Row allows retrieving value by name
2023-07-28 23:22:35 -07:00
Mizaki
2187ddece8 Move volume from ComicSeries to ComicIssue 2023-06-23 22:38:15 +01:00
Timmy Welch
a912c7392b Merge branch 'mizaki-additional_comic_fields' into develop 2023-06-03 10:37:44 -07:00
Mizaki
c3892082f5 Change data to metadata 2023-06-02 00:37:58 +01:00
Mizaki
92e2cb42e8 Replace instances of Comic Vine to use the talker's name 2023-06-01 22:05:14 +01:00
Mizaki
d191750231 Remove attempted validation of language and country plus minor changes 2023-05-25 01:32:52 +01:00
Mizaki
e72347656b Add format (1-shot, limited series, etc.) 2023-05-23 00:27:58 +01:00
Mizaki
97e64fa918 Add maturity_rating, language and country to ComicIssue and pass to metadata. 2023-05-18 02:02:21 +01:00
Mizaki
0b77078a93 Retrieve all fields instead of by (many) names 2023-05-12 23:46:34 +01:00
Mizaki
ddf4407b77 Merge branch 'develop' into additional_comic_fields 2023-05-12 22:41:38 +01:00
Mizaki
6cf259191e Add volume and count_of_volumes to ComicSeries 2023-05-12 21:48:45 +01:00
Timmy Welch
c437532622
Merge branch 'mizaki-cache_role_fix' into develop 2023-02-17 10:21:54 -08:00
Timmy Welch
2491999a33
Update copyright statements to ComicTagger Authors 2023-02-16 17:23:13 -08:00
Mizaki
b727b1288d Apply credit datatype to person data from cache 2023-02-15 17:05:14 +00:00
Mizaki
73738010b8 Add additional fields to ComicIssue and add a genre field to ComicSeries to allow for filtering of search results from the cache. 2023-02-15 16:48:07 +00:00
Timmy Welch
4eb9e008ce
Update pre-commit 2023-02-10 00:25:20 -08:00
Timmy Welch
9d8cf41cd3
Fix try block parsing credits in ComicCacher 2022-12-31 12:36:32 -08:00
Timmy Welch
734b83cade
Switch comictalker TypedDicts to dataclasses 2022-12-23 01:58:10 -08:00
Timmy Welch
9f00af4bba
Change issue id and series id to strings 2022-12-23 00:09:19 -08:00
Timmy Welch
1d9840913a
Change all references of volume to series 2022-12-22 10:16:05 -08:00
Timmy Welch
fc4eb4f002
Cleanup
Move most options passed in to ComicVineTalker to ComicTalker
Give ComicCacher and ComicTalker a version argument to remove all
  references to comictaggerlib
Update default arguments to reflect what is required to use these classes
2022-11-25 19:22:01 -08:00
Mizaki
38c3014222 Use strip().splitlines() in cacher to prevent [''] return. Some clean up. 2022-11-17 15:55:38 +00:00
Mizaki
63e6174cf2 Not all fields are required in ComicVolume and ComicIssue but cacher would fail if any optional field were missing. 2022-11-07 01:38:19 +00:00
Mizaki
a724fd8430 Compensate for a split empty string returning ['']. I don't see a way around this? 2022-11-05 01:21:51 +00:00
Mizaki
b4f6820f56 remove_fetch_alternate_cover_urls.patch 2022-11-03 23:32:35 +00:00
Mizaki
86402af8b1 Merge branch 'develop' into infosources
# Conflicts:
#	comictaggerlib/comicvinetalker.py
2022-10-30 11:39:01 +00:00
Mizaki
a06d88efc0 Fix up full issue cache types. 2022-10-29 01:33:42 +01:00
Mizaki
bf06b94284 Enable cache for full issue information. 2022-10-28 22:15:14 +01:00
Mizaki
561dc28044 Don't proxy talker (really this time). Remove talker custom logging. Move static_options and settings_options to root of class object. Temp hack to keep talker menu genration working until settings revamp. 2022-10-27 23:36:57 +01:00
Mizaki
4514ae80d0 Switch to API data for alt images, remove unneeded functions and removed async as new approach needed. See comments about fetch_partial_volume_data 2022-10-26 00:29:30 +01:00
Mizaki
c5ad75370f Work around having to scrape alt covers from CV. Use cache to get issue page url for scrape. 2022-10-24 16:30:58 +01:00
Mizaki
d23258f359 Change ComicVolume, ComicIssue to image_url and image_thumb_url. Add/change search/volume DB layout to remove duplication of data. Fixup some test. 2022-10-23 22:40:15 +01:00
Mizaki
c9cd58fecb Remove fetch_issue_cover_urls and async_fetch_issue_cover_urls. Reduce API calls by using data already available with coverimagewidget. 2022-10-22 01:43:56 +01:00
Mizaki
4be12d857d Reuse CV test data in comic_issue_result data. Cover possible empty volume data in get_volume_issues_info. 2022-10-19 23:30:11 +01:00
Mizaki
e1ab72ec2a Rename super_url to image_url in comiccacher. Merge fetch_issue_data_by_issue_id into fetch_comic_data. Fill comic volume info in comiccacher:get_volume_issues_info 2022-10-19 19:33:51 +01:00
Mizaki
18d861a2be More test fixes that may need to be looked at further. 2022-10-09 23:43:52 +01:00
Mizaki
d37e4607ee After merge. Testing files still to update. 2022-10-04 23:50:55 +01:00
Mizaki
00e95178cd Initial support for multiple comic information sources 2022-10-04 01:08:14 +01:00