mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-15 09:00:51 -08:00
feat: make episode previews unique by using a prefix
This commit is contained in:
@@ -195,6 +195,7 @@ def get_anime_preview(
|
|||||||
.replace("{info_cache_path}", str(INFO_CACHE_DIR))
|
.replace("{info_cache_path}", str(INFO_CACHE_DIR))
|
||||||
.replace("{path_sep}", path_sep)
|
.replace("{path_sep}", path_sep)
|
||||||
.replace("{image_renderer}", config.general.image_renderer)
|
.replace("{image_renderer}", config.general.image_renderer)
|
||||||
|
.replace("{PREFIX}", "")
|
||||||
)
|
)
|
||||||
# )
|
# )
|
||||||
|
|
||||||
@@ -249,7 +250,7 @@ def _episode_cache_worker(episodes: List[str], anime: MediaItem, config: AppConf
|
|||||||
|
|
||||||
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
|
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
|
||||||
for episode_str in episodes:
|
for episode_str in episodes:
|
||||||
hash_id = _get_cache_hash(episode_str)
|
hash_id = _get_cache_hash(f"{anime.title.english}_Episode_{episode_str}")
|
||||||
|
|
||||||
# Find matching streaming episode
|
# Find matching streaming episode
|
||||||
episode_data = None
|
episode_data = None
|
||||||
@@ -334,6 +335,7 @@ def get_episode_preview(
|
|||||||
.replace("{info_cache_path}", str(INFO_CACHE_DIR))
|
.replace("{info_cache_path}", str(INFO_CACHE_DIR))
|
||||||
.replace("{path_sep}", path_sep)
|
.replace("{path_sep}", path_sep)
|
||||||
.replace("{image_renderer}", config.general.image_renderer)
|
.replace("{image_renderer}", config.general.image_renderer)
|
||||||
|
.replace("{PREFIX}", f"{anime.title.english}_Episode_")
|
||||||
)
|
)
|
||||||
|
|
||||||
os.environ["SHELL"] = "bash"
|
os.environ["SHELL"] = "bash"
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ fzf_preview() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
# Generate the same cache key that the Python worker uses
|
# Generate the same cache key that the Python worker uses
|
||||||
hash=$(generate_sha256 {})
|
title={}
|
||||||
|
hash=$(generate_sha256 "{PREFIX}$title")
|
||||||
|
|
||||||
# Display image if configured and the cached file exists
|
# Display image if configured and the cached file exists
|
||||||
if [ "{preview_mode}" = "full" ] || [ "{preview_mode}" = "image" ]; then
|
if [ "{preview_mode}" = "full" ] || [ "{preview_mode}" = "image" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user