funread 1.2.7__tar.gz → 1.2.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {funread-1.2.7 → funread-1.2.8}/PKG-INFO +1 -1
- {funread-1.2.7 → funread-1.2.8}/pyproject.toml +1 -1
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/reader/registry.py +5 -2
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/reader/service.py +6 -2
- {funread-1.2.7 → funread-1.2.8}/tests/reader/test_reader_service.py +9 -0
- {funread-1.2.7 → funread-1.2.8}/tests/reader/test_registry.py +11 -0
- {funread-1.2.7 → funread-1.2.8}/.github/FUNDING.yml +0 -0
- {funread-1.2.7 → funread-1.2.8}/.github/workflows/ci.yml +0 -0
- {funread-1.2.7 → funread-1.2.8}/.gitignore +0 -0
- {funread-1.2.7 → funread-1.2.8}/CHANGELOG.md +0 -0
- {funread-1.2.7 → funread-1.2.8}/LICENSE +0 -0
- {funread-1.2.7 → funread-1.2.8}/README.md +0 -0
- {funread-1.2.7 → funread-1.2.8}/example/run.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/example/run1.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/example/run3.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/scripts/setup.sh +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/base/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/base/config.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/backends/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/backends/html.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/backends/jsonx.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/backends/regexrow.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/book.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/errors.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/evaluator.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/expr.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/feed.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/fetch.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/js/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/js/base.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/js/host.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/js/null.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/js/quickjs_runtime.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/lexer.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/models.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/nodes.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/opml.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/rss.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/runtime.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/source.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/values.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/engine/variables.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/context.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/core/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/core/constants.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/core/db_backup.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/core/processor.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/core/store.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/reporting/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/reporting/builder.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/reporting/remote.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/sources/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/sources/book.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/sources/factory.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/sources/rss.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/download/task.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/publish/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/publish/entrance.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/publish/rss.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/source/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/source/check/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/source/check/task.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/source/merge/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/source/merge/task.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/source/storage.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/source/sync/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/source/sync/task.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/utils/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/utils/core.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/manage/utils/worker.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/net/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/net/charset.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/net/fetcher.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/net/probe.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/net/survey.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/reader/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/reader/matching.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/reader/rss_service.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/legado/reader/storage.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/py.typed +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/scripts/__init__.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/src/funread/scripts/command.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/conftest.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_book_flow.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_combinators_and_regex.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_default_dialect.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_dialects.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_feed_parser.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_js_boundary.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_js_quickjs.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_no_heavy_imports.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_opml.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_rss_engine.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_source_spec.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_source_spec_rss.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_url_options.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/engine/test_variables_and_interpolation.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/net/test_charset.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/net/test_requests_fetcher.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/net/test_survey.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/reader/test_chapter_matching.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/reader/test_reader_storage.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/reader/test_rss_service.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/reader/test_rss_storage.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/reader/test_user_scoping.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/test_config.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/test_db_backup.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/test_download_base.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/test_publish_and_parse.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/test_publish_optional_fundrive.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/test_report_builder.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/test_source_download_storage.py +0 -0
- {funread-1.2.7 → funread-1.2.8}/tests/test_task_database_resolution.py +0 -0
|
@@ -140,7 +140,7 @@ class SourceRegistry:
|
|
|
140
140
|
needs_js = spec.needs_js()
|
|
141
141
|
web_view = spec.is_web_view
|
|
142
142
|
has_explore = bool(
|
|
143
|
-
spec.
|
|
143
|
+
any(kind.url for kind in spec.explore_kinds())
|
|
144
144
|
and (
|
|
145
145
|
spec.has_rule("ruleExplore", "bookList") or spec.has_rule("ruleSearch", "bookList")
|
|
146
146
|
)
|
|
@@ -218,7 +218,10 @@ class SourceRegistry:
|
|
|
218
218
|
spec.is_complete,
|
|
219
219
|
not spec.is_web_view,
|
|
220
220
|
not spec.needs_js(),
|
|
221
|
-
bool(
|
|
221
|
+
bool(
|
|
222
|
+
any(kind.url for kind in spec.explore_kinds())
|
|
223
|
+
and spec.has_rule("ruleExplore", "bookList")
|
|
224
|
+
),
|
|
222
225
|
len(spec.raw),
|
|
223
226
|
)
|
|
224
227
|
if identity not in unique or quality > unique[identity][0]:
|
|
@@ -398,7 +398,7 @@ class ReaderService:
|
|
|
398
398
|
spec = self.registry.load_spec(int(pref.url_id))
|
|
399
399
|
if spec is None:
|
|
400
400
|
continue
|
|
401
|
-
kinds = [kind.name for kind in spec.explore_kinds() if kind.
|
|
401
|
+
kinds = [kind.name or spec.name for kind in spec.explore_kinds() if kind.url]
|
|
402
402
|
if not kinds:
|
|
403
403
|
continue
|
|
404
404
|
items.append(
|
|
@@ -419,7 +419,11 @@ class ReaderService:
|
|
|
419
419
|
顺序反过来就可能把选项拼坏。
|
|
420
420
|
"""
|
|
421
421
|
spec = self._spec(url_id)
|
|
422
|
-
kinds = [
|
|
422
|
+
kinds = [
|
|
423
|
+
{"name": kind.name or spec.name, "url": kind.url}
|
|
424
|
+
for kind in spec.explore_kinds()
|
|
425
|
+
if kind.url
|
|
426
|
+
]
|
|
423
427
|
if not kinds:
|
|
424
428
|
raise LookupError("这个源没有可浏览的分类")
|
|
425
429
|
return kinds
|
|
@@ -594,6 +594,15 @@ def test_explore_sources_includes_the_category_names(make_service):
|
|
|
594
594
|
assert service.explore_sources()["items"][0]["kinds"] == ["玄幻", "都市"]
|
|
595
595
|
|
|
596
596
|
|
|
597
|
+
def test_explore_sources_names_an_unnamed_category(make_service):
|
|
598
|
+
service = make_service(
|
|
599
|
+
pages={}, sources={1: _explore_source("a.example.com", "甲源", kinds="/browse")}
|
|
600
|
+
)
|
|
601
|
+
|
|
602
|
+
assert service.explore_sources()["items"][0]["kinds"] == ["甲源"]
|
|
603
|
+
assert service.explore_kinds(1) == [{"name": "甲源", "url": "/browse"}]
|
|
604
|
+
|
|
605
|
+
|
|
597
606
|
def test_explore_sources_filters_and_paginates(make_service):
|
|
598
607
|
service = make_service(
|
|
599
608
|
pages={},
|
|
@@ -363,6 +363,17 @@ def test_ingest_prefers_browsable_duplicate(registry):
|
|
|
363
363
|
assert registry.load_spec(pref.url_id).explore_url == "/browse"
|
|
364
364
|
|
|
365
365
|
|
|
366
|
+
def test_ingest_excludes_sources_without_parseable_explore_kinds(registry):
|
|
367
|
+
source = {
|
|
368
|
+
**GOOD,
|
|
369
|
+
"exploreUrl": '[{"title":"空分类","url":""}]',
|
|
370
|
+
"ruleExplore": {"bookList": "class.item"},
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
assert registry.ingest([[source]]) == 1
|
|
374
|
+
assert registry.prefs(explore_only=True) == []
|
|
375
|
+
|
|
376
|
+
|
|
366
377
|
def test_candidates_respects_the_limit(registry, tmp_path):
|
|
367
378
|
hubs = tmp_path / "hubs"
|
|
368
379
|
for index in range(1, 6):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|