Select source screen: quick filter switching, compact skin with collapsable sidebar#98
Draft
Select source screen: quick filter switching, compact skin with collapsable sidebar#98
Conversation
Collaborator
Author
|
Some components have been added: 1. Enrichers (Metadata Enhancers)Enrichers add or modify metadata in items (dictionaries) based on specific patterns in their data.
2. EnricherBuilderOrchestrates the sequential application of enrichers to a list of items.
3. FilterBuilderApplies filters, sorting, and limits to refine processed items.
How It Works: Example ScenarioGoal: Process torrent items to:
# Sample Items
items = [
{"title": "Show.Name.S02E05.1080p", "description": "👤 150 🌐 ProviderA 🇺🇸"},
{"title": "Show.Name.Complete.S02", "description": "👤 80 🇬🇧"}
]
# 1. Enrichment Pipeline
enriched = (
EnricherBuilder(items)
.add(LanguageEnricher(language_map={"🇺🇸": "en"}, keywords={"english"}))
.add(QualityEnricher())
.add(IsPackEnricher(season_number=2))
.add(StatsEnricher(size_converter=some_size_function))
.build()
)
# 2. Filtering/Sorting
filtered = (
FilterBuilder(enriched)
.filter_by_language("en")
.filter_by_episode(episode_name="", episode_num=5, season_num=2)
.filter_by_source() # Ensure items have infoHash/guid
.sort_by("seeders", ascending=False)
.sort_by("quality_sort") # Secondary sort
.limit(10)
.build()
)Output: [
{
"title": "Show.Name.S02E05.1080p",
"languages": ["en"],
"quality": "[B][COLOR blue]1080p[/COLOR][/B]",
"isPack": False,
"seeders": 150,
"size": "5.2 GB",
"provider": "ProviderA"
}
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow navigation between different sections, each representing a filter or sorting mechanism, using the left and right arrow keys.