Commit Graph

157 Commits

Author SHA1 Message Date
Timmy Welch
25e5134577 Cache more ComicVine lookups 2024-09-19 17:31:06 -07:00
Timmy Welch
4c9096a11b Implement the most basic local plugin isolation possible
Remove modules belonging to local plugins after loading
Remove sys.path entry after loading

This means that multiple local plugins can be installed with the same import path and should work correctly
This does not allow loading a local plugin that has the same import path as an installed plugin
2024-09-15 17:09:33 -07:00
Timmy Welch
c9c0c99a2a Increase rate limits on CV to cover the 200 requests/Hr restriction
Add twitter's alternative to HTTP code 429
2024-09-12 13:56:57 -07:00
Timmy Welch
582224abec Fixes for quick-tag 2024-09-12 11:51:38 -07:00
Timmy Welch
fab30f3f29 Add experimental quick-tag 2024-08-18 19:16:55 -07:00
Timmy Welch
2cb6caea8d Ignore update with incomplete data when complete data is already cached 2024-08-16 17:05:28 -07:00
Timmy Welch
e452fa153b Fix issues from static analysis 2024-06-22 20:21:01 -07:00
Timmy Welch
3389c72a63 Merge branch 'help-messages' into develop 2024-06-21 19:53:30 -07:00
Timmy Welch
69a9566f42 Update all references of saved 'matadata' to 'tags' 2024-06-20 16:47:10 -07:00
Timmy Welch
6132af3bb5 Support niquests 2024-06-09 13:09:26 -07:00
Timmy Welch
5e6682566f Allow results to include comics in the following year fixes #638 2024-06-08 19:17:42 -07:00
Timmy Welch
a681abb854 Consolidate preparing metadata for save 2024-04-27 15:29:34 -07:00
Timmy Welch
c311b8e351 Use comicapi for all urllib3 items 2024-04-12 14:39:34 -07:00
Timmy Welch
3df263858d Merge branch 'web-links' into develop 2024-03-09 13:42:29 -08:00
Timmy Welch
2eca743f20 Fix #602
Tests were not made correctly to catch the change in 2c3a2566cc
This has now been corrected
2024-02-18 17:31:00 -08:00
Timmy Welch
44e9a47a8b Support multiple web_links 2024-02-17 17:42:07 -08:00
Timmy Welch
8ec16528ab Implement local plugins 2024-02-10 21:00:24 -08:00
pre-commit-ci[bot]
df762746ec [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-29 17:14:26 +00:00
Timmy Welch
04b3b6b4ab Do not normalize series_name when a literal search is requested 2023-12-17 19:14:38 -08:00
Timmy Welch
3b2e763d7d Merge branch 'json-output' into develop 2023-12-17 18:28:53 -08:00
Timmy Welch
bb67ab009e Ensure that all output goes through a logger before output to the user
Adds an option to output json for CLI options
2023-12-17 15:51:43 -08:00
Mizaki
fc6e0c3db3 Parse ct version only once 2023-12-12 23:47:47 +00:00
Mizaki
4d2b9e1157 Warn on bad min ct required verion and use anyway. Use clearer log messages 2023-12-01 14:09:17 +00:00
Mizaki
f977e70562 Rename min ct required var. Use a minimum version only check instead of full spec 2023-12-01 01:23:46 +00:00
Mizaki
12dd06c558 Add CT verion check against talker requirements 2023-11-30 01:50:28 +00:00
Timmy Welch
99325f40cf Merge branch 'mizaki/cleanup_html' into develop 2023-11-23 16:12:02 -08:00
Timmy Welch
305eb1dec5 Enable stricter mypy configuration 2023-11-23 16:05:16 -08:00
Mizaki
987f3fc564 cleanup_html improvements 2023-11-13 01:41:26 +00:00
Timmy Welch
f250d2c5c3 Merge branch 'mizaki-gmd_list_set' into develop 2023-10-04 20:16:33 -07:00
Mizaki
058651cc29 Change metadata lists to sets. Changed CV talker to reflect and tidied 2023-09-24 14:33:57 +01:00
Mizaki
5874f3bcaf Remove genres from ComicSeries as it is no longer required with the new cache system 2023-09-22 23:15:04 +01:00
Mizaki
df3e7912b3 Add talker information in setting window 2023-09-17 18:26:06 +01:00
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
Timmy Welch
f90f373d20 Merge branch 'mizaki-rate_limit_cv' into develop 2023-07-01 18:04:24 -07:00
Timmy Welch
c246b96845 Merge branch 'mizaki-vol_to_issue' into develop 2023-07-01 18:02:57 -07:00
Mizaki
37cc66cbae Use requests.status_codes.codes.TOO_MANY_REQUESTS 2023-06-27 17:48:38 +01:00
Timmy Welch
2e01672e68 Fix #485
As mentioned in the comment in comictaggerlib/main.py:186
The default value should be None not the empty string.
We also check if the given value is the default or the empty string and
 the setting is unset so the default value is not saved in the settings
 file.
The default_api_url is shown in the GUI Settings Window it is not
 currently show in the cli help.
2023-06-23 17:48:18 -07:00
Timmy Welch
4a7aae4045 Add tests for fix_url 2023-06-23 17:10:40 -07:00
Mizaki
2187ddece8 Move volume from ComicSeries to ComicIssue 2023-06-23 22:38:15 +01:00
Mizaki
fba5518d06 Create two module limiters and assign class limiter var depending. Add to welcome message limits of default CV API key. 2023-06-23 21:25:02 +01:00
Timmy Welch
31cf687e2f Reduce startup time 2023-06-22 20:11:40 -07:00
Timmy Welch
635cb037f1 Merge branch 'mizaki-fix_add_fields' into develop 2023-06-22 17:51:26 -07:00
Mizaki
861584df3a Move rate limit check from defunc API status code 107 to HTTP code 429. Set a limit of 10 request every 10 seconds except for the default API key which is 1,2 (to be finisalised). Remove wait on rate limit option. 2023-06-22 23:50:32 +01:00
Mizaki
7a91acb60c Add pyrate-limiter and apply CV suggested rate limit 2023-06-20 22:28:29 +01:00
Timmy Welch
3a287504ae Fix setting issue and alternate_number on GenericMetadata
IssueString.as_string always returns a string this is a problem for
  GenericMetadata. When the overlay function is used it checks
  specifically for the value None this allows the -m option to unset
  attributes however the issue attribute would get set to the empty
  string when loading ComicRack tags regardless of if there was a value
  stored in the file. Fixes #465 and #480
2023-06-15 20:26:38 -07:00
Mizaki
2afb604ab3 Fix issue_count and add maturity rating 2023-06-08 00:52:24 +01:00
Timmy Welch
a912c7392b Merge branch 'mizaki-additional_comic_fields' into develop 2023-06-03 10:37:44 -07:00