From e49fb4898c5401e74127bb35d2a6f9632ee8231b Mon Sep 17 00:00:00 2001 From: Benexl Date: Sat, 16 Aug 2025 16:17:42 +0300 Subject: [PATCH] refactor: rename to viu --- .github/chatmodes/new-command.chatmode.md | 18 +- .github/chatmodes/new-component.chatmode.md | 22 +-- .github/chatmodes/new-provider.chatmode.md | 18 +- .github/chatmodes/plan.chatmode.md | 16 +- .github/copilot-instructions.md | 58 +++--- .github/workflows/build.yml | 4 +- .github/workflows/publish.yml | 11 +- CONTRIBUTIONS.md | 60 +++---- DISCLAIMER.md | 2 +- README.md | 106 +++++------ bundle/Dockerfile | 4 +- bundle/pyinstaller.spec | 12 +- completions/{fastanime.bash => viu.bash} | 10 +- completions/{fastanime.fish => viu.fish} | 6 +- completions/{fastanime.zsh => viu.zsh} | 12 +- dev/generate_completions.sh | 6 +- dev/make_release | 6 +- fa | 2 +- fastanime/assets/defaults/ascii-art | 6 - fastanime/cli/commands/anilist/examples.py | 169 ------------------ fastanime/cli/commands/registry/examples.py | 31 ---- fastanime/core/utils/__init__.py | 7 - flake.nix | 12 +- pyproject.toml | 4 +- uv.lock | 2 +- {fastanime => viu}/__init__.py | 2 +- {fastanime => viu}/__main__.py | 0 viu/assets/defaults/ascii-art | 7 + {fastanime => viu}/assets/defaults/fzf-opts | 0 .../assets/defaults/rofi-themes/confirm.rasi | 2 +- .../assets/defaults/rofi-themes/input.rasi | 2 +- .../assets/defaults/rofi-themes/main.rasi | 2 +- .../assets/defaults/rofi-themes/preview.rasi | 2 +- .../defaults/viu-worker.template.service | 6 +- .../assets/graphql/allanime/queries/anime.gql | 0 .../graphql/allanime/queries/episodes.gql | 0 .../graphql/allanime/queries/search.gql | 0 .../anilist/mutations/delete-list-entry.gql | 0 .../graphql/anilist/mutations/mark-read.gql | 0 .../graphql/anilist/mutations/media-list.gql | 0 .../anilist/queries/logged-in-user.gql | 0 .../anilist/queries/media-airing-schedule.gql | 0 .../anilist/queries/media-characters.gql | 0 .../anilist/queries/media-list-item.gql | 0 .../graphql/anilist/queries/media-list.gql | 0 .../anilist/queries/media-recommendations.gql | 0 .../anilist/queries/media-relations.gql | 0 .../graphql/anilist/queries/notifications.gql | 0 .../graphql/anilist/queries/reviews.gql | 0 .../assets/graphql/anilist/queries/search.gql | 0 .../graphql/anilist/queries/user-info.gql | 0 {fastanime => viu}/assets/icons/logo.ico | Bin {fastanime => viu}/assets/icons/logo.png | Bin {fastanime => viu}/assets/normalizer.json | 0 .../fzf/airing-schedule-info.template.sh | 2 +- .../fzf/airing-schedule-preview.template.sh | 0 .../scripts/fzf/character-info.template.sh | 2 +- .../scripts/fzf/character-preview.template.sh | 0 .../scripts/fzf/dynamic-preview.template.sh | 0 .../scripts/fzf/episode-info.template.sh | 0 .../assets/scripts/fzf/info.template.sh | 2 +- .../assets/scripts/fzf/preview.template.sh | 0 .../scripts/fzf/review-info.template.sh | 2 +- .../scripts/fzf/review-preview.template.sh | 0 .../assets/scripts/fzf/search.template.sh | 0 {fastanime => viu}/cli/__init__.py | 0 {fastanime => viu}/cli/cli.py | 4 +- {fastanime => viu}/cli/commands/__init__.py | 0 .../cli/commands/anilist/__init__.py | 0 .../cli/commands/anilist/cmd.py | 2 +- .../cli/commands/anilist/commands/__init__.py | 0 .../cli/commands/anilist/commands/auth.py | 0 .../cli/commands/anilist/commands/download.py | 32 ++-- .../commands/anilist/commands/downloads.py | 0 .../anilist/commands/notifications.py | 8 +- .../cli/commands/anilist/commands/search.py | 14 +- .../cli/commands/anilist/commands/stats.py | 4 +- viu/cli/commands/anilist/examples.py | 169 ++++++++++++++++++ .../cli/commands/completions.py | 36 ++-- {fastanime => viu}/cli/commands/config.py | 24 +-- {fastanime => viu}/cli/commands/download.py | 26 +-- {fastanime => viu}/cli/commands/examples.py | 38 ++-- {fastanime => viu}/cli/commands/queue.py | 28 +-- .../cli/commands/queue/__init__.py | 0 {fastanime => viu}/cli/commands/queue/cmd.py | 2 +- .../cli/commands/queue/commands/__init__.py | 0 .../cli/commands/queue/commands/add.py | 28 +-- .../cli/commands/queue/commands/clear.py | 8 +- .../cli/commands/queue/commands/list.py | 8 +- .../cli/commands/queue/commands/resume.py | 12 +- .../cli/commands/registry/__init__.py | 0 .../cli/commands/registry/cmd.py | 2 +- .../commands/registry/commands/__init__.py | 0 .../cli/commands/registry/commands/backup.py | 4 +- .../cli/commands/registry/commands/clean.py | 0 .../cli/commands/registry/commands/export.py | 4 +- .../cli/commands/registry/commands/import_.py | 2 +- .../cli/commands/registry/commands/restore.py | 2 +- .../cli/commands/registry/commands/search.py | 0 .../cli/commands/registry/commands/stats.py | 0 .../cli/commands/registry/commands/sync.py | 6 +- viu/cli/commands/registry/examples.py | 31 ++++ {fastanime => viu}/cli/commands/search.py | 28 +-- {fastanime => viu}/cli/commands/update.py | 20 +-- {fastanime => viu}/cli/commands/worker.py | 20 +-- {fastanime => viu}/cli/config/__init__.py | 0 {fastanime => viu}/cli/config/editor.py | 2 +- {fastanime => viu}/cli/config/generate.py | 2 +- {fastanime => viu}/cli/config/loader.py | 2 +- .../menu/media/download_episodes.py | 0 .../cli/interactive/menu/media/downloads.py | 0 .../interactive/menu/media/dynamic_search.py | 0 .../cli/interactive/menu/media/episodes.py | 0 .../cli/interactive/menu/media/main.py | 0 .../interactive/menu/media/media_actions.py | 0 .../menu/media/media_airing_schedule.py | 0 .../menu/media/media_characters.py | 0 .../interactive/menu/media/media_review.py | 0 .../interactive/menu/media/play_downloads.py | 0 .../interactive/menu/media/player_controls.py | 0 .../interactive/menu/media/provider_search.py | 0 .../cli/interactive/menu/media/results.py | 0 .../cli/interactive/menu/media/servers.py | 0 {fastanime => viu}/cli/interactive/session.py | 2 +- {fastanime => viu}/cli/interactive/state.py | 0 {fastanime => viu}/cli/options.py | 0 .../cli/service/auth/__init__.py | 0 {fastanime => viu}/cli/service/auth/model.py | 0 .../cli/service/auth/service.py | 0 .../cli/service/download/__init__.py | 0 .../cli/service/download/service.py | 12 +- .../cli/service/feedback/__init__.py | 0 .../cli/service/feedback/service.py | 0 .../cli/service/notification/service.py | 16 +- .../cli/service/player/__init__.py | 0 .../cli/service/player/ipc/base.py | 0 .../cli/service/player/ipc/mpv.py | 28 +-- .../cli/service/player/service.py | 4 +- .../cli/service/registry/__init__.py | 0 .../cli/service/registry/models.py | 0 .../cli/service/registry/service.py | 4 +- .../cli/service/session/__init__.py | 0 .../cli/service/session/model.py | 0 .../cli/service/session/service.py | 0 .../cli/service/watch_history/__init__.py | 0 .../cli/service/watch_history/service.py | 0 .../cli/service/worker/service.py | 6 +- {fastanime => viu}/cli/utils/__init__.py | 0 {fastanime => viu}/cli/utils/ansi.py | 0 {fastanime => viu}/cli/utils/completion.py | 0 {fastanime => viu}/cli/utils/exception.py | 0 {fastanime => viu}/cli/utils/feh.py | 0 {fastanime => viu}/cli/utils/icat.py | 0 {fastanime => viu}/cli/utils/image.py | 0 {fastanime => viu}/cli/utils/lazyloader.py | 0 {fastanime => viu}/cli/utils/logging.py | 0 {fastanime => viu}/cli/utils/parser.py | 2 +- {fastanime => viu}/cli/utils/preview.py | 0 .../cli/utils/preview_workers.py | 0 {fastanime => viu}/cli/utils/update.py | 2 +- {fastanime => viu}/core/__init__.py | 0 {fastanime => viu}/core/config/__init__.py | 0 {fastanime => viu}/core/config/defaults.py | 0 .../core/config/descriptions.py | 2 +- {fastanime => viu}/core/config/model.py | 2 +- {fastanime => viu}/core/constants.py | 6 +- .../core/downloader/__init__.py | 0 {fastanime => viu}/core/downloader/base.py | 0 {fastanime => viu}/core/downloader/default.py | 6 +- .../core/downloader/downloader.py | 6 +- {fastanime => viu}/core/downloader/model.py | 0 {fastanime => viu}/core/downloader/params.py | 0 .../core/downloader/torrents.py | 6 +- {fastanime => viu}/core/downloader/yt_dlp.py | 6 +- {fastanime => viu}/core/exceptions.py | 16 +- {fastanime => viu}/core/patterns.py | 0 viu/core/utils/__init__.py | 7 + {fastanime => viu}/core/utils/concurrency.py | 0 {fastanime => viu}/core/utils/converter.py | 0 {fastanime => viu}/core/utils/detect.py | 0 {fastanime => viu}/core/utils/file.py | 0 {fastanime => viu}/core/utils/formatter.py | 0 {fastanime => viu}/core/utils/fuzzy.py | 6 +- {fastanime => viu}/core/utils/graphql.py | 0 {fastanime => viu}/core/utils/networking.py | 0 {fastanime => viu}/core/utils/normalizer.py | 0 {fastanime => viu}/libs/__init__.py | 0 {fastanime => viu}/libs/aniskip/__init__.py | 0 {fastanime => viu}/libs/aniskip/api.py | 0 {fastanime => viu}/libs/discord/__init__.py | 0 {fastanime => viu}/libs/discord/api.py | 0 {fastanime => viu}/libs/media_api/__init__.py | 0 .../libs/media_api/anilist/__init__.py | 0 .../libs/media_api/anilist/api.py | 0 .../libs/media_api/anilist/gql.py | 0 .../libs/media_api/anilist/mapper.py | 0 .../libs/media_api/anilist/types.py | 0 {fastanime => viu}/libs/media_api/api.py | 4 +- {fastanime => viu}/libs/media_api/base.py | 0 .../libs/media_api/jikan/__init__.py | 0 .../libs/media_api/jikan/api.py | 0 .../libs/media_api/jikan/mapper.py | 0 {fastanime => viu}/libs/media_api/params.py | 0 {fastanime => viu}/libs/media_api/types.py | 0 .../libs/media_api/utils/debug.py | 2 +- {fastanime => viu}/libs/player/__init__.py | 2 +- {fastanime => viu}/libs/player/base.py | 2 +- .../libs/player/mpv/__init__.py | 0 {fastanime => viu}/libs/player/mpv/player.py | 16 +- {fastanime => viu}/libs/player/params.py | 0 {fastanime => viu}/libs/player/player.py | 2 +- .../libs/player/syncplay/__init__.py | 0 .../libs/player/syncplay/player.py | 2 +- {fastanime => viu}/libs/player/types.py | 0 .../libs/player/vlc/__init__.py | 0 {fastanime => viu}/libs/player/vlc/player.py | 10 +- {fastanime => viu}/libs/provider/__init__.py | 0 .../libs/provider/anime/__init__.py | 0 .../libs/provider/anime/allanime/__init__.py | 0 .../libs/provider/anime/allanime/constants.py | 0 .../anime/allanime/extractors/__init__.py | 0 .../provider/anime/allanime/extractors/ak.py | 0 .../anime/allanime/extractors/base.py | 0 .../anime/allanime/extractors/dropbox.py | 0 .../anime/allanime/extractors/extractor.py | 0 .../anime/allanime/extractors/filemoon.py | 0 .../anime/allanime/extractors/gogoanime.py | 0 .../anime/allanime/extractors/mp4_upload.py | 0 .../anime/allanime/extractors/sharepoint.py | 0 .../anime/allanime/extractors/streamsb.py | 0 .../anime/allanime/extractors/vid_mp4.py | 0 .../anime/allanime/extractors/we_transfer.py | 0 .../anime/allanime/extractors/wixmp.py | 0 .../anime/allanime/extractors/yt_mp4.py | 0 .../libs/provider/anime/allanime/mappers.py | 0 .../libs/provider/anime/allanime/provider.py | 0 .../libs/provider/anime/allanime/types.py | 0 .../libs/provider/anime/allanime/utils.py | 2 +- .../libs/provider/anime/animepahe/__init__.py | 0 .../provider/anime/animepahe/constants.py | 0 .../provider/anime/animepahe/extractor.py | 0 .../libs/provider/anime/animepahe/mappers.py | 0 .../libs/provider/anime/animepahe/provider.py | 0 .../libs/provider/anime/animepahe/types.py | 0 .../libs/provider/anime/base.py | 0 .../libs/provider/anime/params.py | 0 .../libs/provider/anime/provider.py | 2 +- .../libs/provider/anime/types.py | 0 .../libs/provider/anime/utils/debug.py | 2 +- .../libs/provider/manga/MangaProvider.py | 2 +- .../libs/provider/manga/__init__.py | 0 .../libs/provider/manga/base.py | 0 .../libs/provider/manga/common.py | 0 .../libs/provider/manga/mangadex/__init__.py | 0 .../libs/provider/manga/mangadex/api.py | 0 .../libs/provider/scraping/__init__.py | 0 .../libs/provider/scraping/html_parser.py | 0 .../libs/provider/scraping/user_agents.py | 0 .../libs/provider/scraping/utils.py | 0 {fastanime => viu}/libs/selectors/__init__.py | 0 {fastanime => viu}/libs/selectors/base.py | 0 .../libs/selectors/fzf/__init__.py | 0 .../libs/selectors/fzf/selector.py | 4 +- .../libs/selectors/inquirer/__init__.py | 0 .../libs/selectors/inquirer/selector.py | 0 .../libs/selectors/rofi/__init__.py | 0 .../libs/selectors/rofi/selector.py | 0 {fastanime => viu}/libs/selectors/selector.py | 0 fastanime/fastanime.py => viu/viu.py | 2 +- 269 files changed, 694 insertions(+), 702 deletions(-) rename completions/{fastanime.bash => viu.bash} (72%) rename completions/{fastanime.fish => viu.fish} (61%) rename completions/{fastanime.zsh => viu.zsh} (80%) mode change 100755 => 100644 dev/generate_completions.sh mode change 100755 => 100644 dev/make_release mode change 100755 => 100644 fa delete mode 100644 fastanime/assets/defaults/ascii-art delete mode 100644 fastanime/cli/commands/anilist/examples.py delete mode 100644 fastanime/cli/commands/registry/examples.py delete mode 100644 fastanime/core/utils/__init__.py rename {fastanime => viu}/__init__.py (78%) rename {fastanime => viu}/__main__.py (100%) create mode 100644 viu/assets/defaults/ascii-art rename {fastanime => viu}/assets/defaults/fzf-opts (100%) rename {fastanime => viu}/assets/defaults/rofi-themes/confirm.rasi (98%) rename {fastanime => viu}/assets/defaults/rofi-themes/input.rasi (97%) rename {fastanime => viu}/assets/defaults/rofi-themes/main.rasi (98%) rename {fastanime => viu}/assets/defaults/rofi-themes/preview.rasi (97%) rename fastanime/assets/defaults/fastanime-worker.template.service => viu/assets/defaults/viu-worker.template.service (62%) rename {fastanime => viu}/assets/graphql/allanime/queries/anime.gql (100%) rename {fastanime => viu}/assets/graphql/allanime/queries/episodes.gql (100%) rename {fastanime => viu}/assets/graphql/allanime/queries/search.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/mutations/delete-list-entry.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/mutations/mark-read.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/mutations/media-list.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/logged-in-user.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/media-airing-schedule.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/media-characters.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/media-list-item.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/media-list.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/media-recommendations.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/media-relations.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/notifications.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/reviews.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/search.gql (100%) rename {fastanime => viu}/assets/graphql/anilist/queries/user-info.gql (100%) rename {fastanime => viu}/assets/icons/logo.ico (100%) rename {fastanime => viu}/assets/icons/logo.png (100%) rename {fastanime => viu}/assets/normalizer.json (100%) rename {fastanime => viu}/assets/scripts/fzf/airing-schedule-info.template.sh (89%) rename {fastanime => viu}/assets/scripts/fzf/airing-schedule-preview.template.sh (100%) rename {fastanime => viu}/assets/scripts/fzf/character-info.template.sh (96%) rename {fastanime => viu}/assets/scripts/fzf/character-preview.template.sh (100%) rename {fastanime => viu}/assets/scripts/fzf/dynamic-preview.template.sh (100%) rename {fastanime => viu}/assets/scripts/fzf/episode-info.template.sh (100%) rename {fastanime => viu}/assets/scripts/fzf/info.template.sh (96%) mode change 100755 => 100644 rename {fastanime => viu}/assets/scripts/fzf/preview.template.sh (100%) rename {fastanime => viu}/assets/scripts/fzf/review-info.template.sh (88%) rename {fastanime => viu}/assets/scripts/fzf/review-preview.template.sh (100%) rename {fastanime => viu}/assets/scripts/fzf/search.template.sh (100%) rename {fastanime => viu}/cli/__init__.py (100%) rename {fastanime => viu}/cli/cli.py (97%) rename {fastanime => viu}/cli/commands/__init__.py (100%) rename {fastanime => viu}/cli/commands/anilist/__init__.py (100%) rename {fastanime => viu}/cli/commands/anilist/cmd.py (95%) rename {fastanime => viu}/cli/commands/anilist/commands/__init__.py (100%) rename {fastanime => viu}/cli/commands/anilist/commands/auth.py (100%) rename {fastanime => viu}/cli/commands/anilist/commands/download.py (90%) rename {fastanime => viu}/cli/commands/anilist/commands/downloads.py (100%) rename {fastanime => viu}/cli/commands/anilist/commands/notifications.py (86%) rename {fastanime => viu}/cli/commands/anilist/commands/search.py (96%) rename {fastanime => viu}/cli/commands/anilist/commands/stats.py (96%) create mode 100644 viu/cli/commands/anilist/examples.py rename {fastanime => viu}/cli/commands/completions.py (79%) rename {fastanime => viu}/cli/commands/config.py (89%) rename {fastanime => viu}/cli/commands/download.py (91%) rename {fastanime => viu}/cli/commands/examples.py (53%) rename {fastanime => viu}/cli/commands/queue.py (90%) rename {fastanime => viu}/cli/commands/queue/__init__.py (100%) rename {fastanime => viu}/cli/commands/queue/cmd.py (91%) rename {fastanime => viu}/cli/commands/queue/commands/__init__.py (100%) rename {fastanime => viu}/cli/commands/queue/commands/add.py (90%) rename {fastanime => viu}/cli/commands/queue/commands/clear.py (79%) rename {fastanime => viu}/cli/commands/queue/commands/list.py (89%) rename {fastanime => viu}/cli/commands/queue/commands/resume.py (62%) rename {fastanime => viu}/cli/commands/registry/__init__.py (100%) rename {fastanime => viu}/cli/commands/registry/cmd.py (97%) rename {fastanime => viu}/cli/commands/registry/commands/__init__.py (100%) rename {fastanime => viu}/cli/commands/registry/commands/backup.py (98%) rename {fastanime => viu}/cli/commands/registry/commands/clean.py (100%) rename {fastanime => viu}/cli/commands/registry/commands/export.py (98%) rename {fastanime => viu}/cli/commands/registry/commands/import_.py (99%) rename {fastanime => viu}/cli/commands/registry/commands/restore.py (99%) rename {fastanime => viu}/cli/commands/registry/commands/search.py (100%) rename {fastanime => viu}/cli/commands/registry/commands/stats.py (100%) rename {fastanime => viu}/cli/commands/registry/commands/sync.py (98%) create mode 100644 viu/cli/commands/registry/examples.py rename {fastanime => viu}/cli/commands/search.py (87%) rename {fastanime => viu}/cli/commands/update.py (92%) rename {fastanime => viu}/cli/commands/worker.py (67%) rename {fastanime => viu}/cli/config/__init__.py (100%) rename {fastanime => viu}/cli/config/editor.py (98%) rename {fastanime => viu}/cli/config/generate.py (98%) rename {fastanime => viu}/cli/config/loader.py (97%) rename {fastanime => viu}/cli/interactive/menu/media/download_episodes.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/downloads.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/dynamic_search.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/episodes.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/main.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/media_actions.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/media_airing_schedule.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/media_characters.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/media_review.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/play_downloads.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/player_controls.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/provider_search.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/results.py (100%) rename {fastanime => viu}/cli/interactive/menu/media/servers.py (100%) rename {fastanime => viu}/cli/interactive/session.py (99%) rename {fastanime => viu}/cli/interactive/state.py (100%) rename {fastanime => viu}/cli/options.py (100%) rename {fastanime => viu}/cli/service/auth/__init__.py (100%) rename {fastanime => viu}/cli/service/auth/model.py (100%) rename {fastanime => viu}/cli/service/auth/service.py (100%) rename {fastanime => viu}/cli/service/download/__init__.py (100%) rename {fastanime => viu}/cli/service/download/service.py (97%) rename {fastanime => viu}/cli/service/feedback/__init__.py (100%) rename {fastanime => viu}/cli/service/feedback/service.py (100%) rename {fastanime => viu}/cli/service/notification/service.py (92%) rename {fastanime => viu}/cli/service/player/__init__.py (100%) rename {fastanime => viu}/cli/service/player/ipc/base.py (100%) rename {fastanime => viu}/cli/service/player/ipc/mpv.py (96%) rename {fastanime => viu}/cli/service/player/service.py (95%) rename {fastanime => viu}/cli/service/registry/__init__.py (100%) rename {fastanime => viu}/cli/service/registry/models.py (100%) rename {fastanime => viu}/cli/service/registry/service.py (99%) rename {fastanime => viu}/cli/service/session/__init__.py (100%) rename {fastanime => viu}/cli/service/session/model.py (100%) rename {fastanime => viu}/cli/service/session/service.py (100%) rename {fastanime => viu}/cli/service/watch_history/__init__.py (100%) rename {fastanime => viu}/cli/service/watch_history/service.py (100%) rename {fastanime => viu}/cli/service/worker/service.py (96%) rename {fastanime => viu}/cli/utils/__init__.py (100%) rename {fastanime => viu}/cli/utils/ansi.py (100%) rename {fastanime => viu}/cli/utils/completion.py (100%) rename {fastanime => viu}/cli/utils/exception.py (100%) rename {fastanime => viu}/cli/utils/feh.py (100%) rename {fastanime => viu}/cli/utils/icat.py (100%) rename {fastanime => viu}/cli/utils/image.py (100%) rename {fastanime => viu}/cli/utils/lazyloader.py (100%) rename {fastanime => viu}/cli/utils/logging.py (100%) rename {fastanime => viu}/cli/utils/parser.py (98%) rename {fastanime => viu}/cli/utils/preview.py (100%) rename {fastanime => viu}/cli/utils/preview_workers.py (100%) rename {fastanime => viu}/cli/utils/update.py (97%) rename {fastanime => viu}/core/__init__.py (100%) rename {fastanime => viu}/core/config/__init__.py (100%) rename {fastanime => viu}/core/config/defaults.py (100%) rename {fastanime => viu}/core/config/descriptions.py (98%) rename {fastanime => viu}/core/config/model.py (99%) rename {fastanime => viu}/core/constants.py (95%) rename {fastanime => viu}/core/downloader/__init__.py (100%) rename {fastanime => viu}/core/downloader/base.py (100%) rename {fastanime => viu}/core/downloader/default.py (98%) rename {fastanime => viu}/core/downloader/downloader.py (90%) rename {fastanime => viu}/core/downloader/model.py (100%) rename {fastanime => viu}/core/downloader/params.py (100%) rename {fastanime => viu}/core/downloader/torrents.py (98%) rename {fastanime => viu}/core/downloader/yt_dlp.py (98%) rename {fastanime => viu}/core/exceptions.py (90%) rename {fastanime => viu}/core/patterns.py (100%) create mode 100644 viu/core/utils/__init__.py rename {fastanime => viu}/core/utils/concurrency.py (100%) rename {fastanime => viu}/core/utils/converter.py (100%) rename {fastanime => viu}/core/utils/detect.py (100%) rename {fastanime => viu}/core/utils/file.py (100%) rename {fastanime => viu}/core/utils/formatter.py (100%) rename {fastanime => viu}/core/utils/fuzzy.py (98%) rename {fastanime => viu}/core/utils/graphql.py (100%) rename {fastanime => viu}/core/utils/networking.py (100%) rename {fastanime => viu}/core/utils/normalizer.py (100%) rename {fastanime => viu}/libs/__init__.py (100%) rename {fastanime => viu}/libs/aniskip/__init__.py (100%) rename {fastanime => viu}/libs/aniskip/api.py (100%) rename {fastanime => viu}/libs/discord/__init__.py (100%) rename {fastanime => viu}/libs/discord/api.py (100%) rename {fastanime => viu}/libs/media_api/__init__.py (100%) rename {fastanime => viu}/libs/media_api/anilist/__init__.py (100%) rename {fastanime => viu}/libs/media_api/anilist/api.py (100%) rename {fastanime => viu}/libs/media_api/anilist/gql.py (100%) rename {fastanime => viu}/libs/media_api/anilist/mapper.py (100%) rename {fastanime => viu}/libs/media_api/anilist/types.py (100%) rename {fastanime => viu}/libs/media_api/api.py (89%) rename {fastanime => viu}/libs/media_api/base.py (100%) rename {fastanime => viu}/libs/media_api/jikan/__init__.py (100%) rename {fastanime => viu}/libs/media_api/jikan/api.py (100%) rename {fastanime => viu}/libs/media_api/jikan/mapper.py (100%) rename {fastanime => viu}/libs/media_api/params.py (100%) rename {fastanime => viu}/libs/media_api/types.py (100%) rename {fastanime => viu}/libs/media_api/utils/debug.py (99%) rename {fastanime => viu}/libs/player/__init__.py (88%) rename {fastanime => viu}/libs/player/base.py (99%) rename {fastanime => viu}/libs/player/mpv/__init__.py (100%) rename {fastanime => viu}/libs/player/mpv/player.py (95%) rename {fastanime => viu}/libs/player/params.py (100%) rename {fastanime => viu}/libs/player/player.py (95%) rename {fastanime => viu}/libs/player/syncplay/__init__.py (100%) rename {fastanime => viu}/libs/player/syncplay/player.py (97%) rename {fastanime => viu}/libs/player/types.py (100%) rename {fastanime => viu}/libs/player/vlc/__init__.py (100%) rename {fastanime => viu}/libs/player/vlc/player.py (95%) rename {fastanime => viu}/libs/provider/__init__.py (100%) rename {fastanime => viu}/libs/provider/anime/__init__.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/__init__.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/constants.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/__init__.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/ak.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/base.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/dropbox.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/extractor.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/filemoon.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/gogoanime.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/mp4_upload.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/sharepoint.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/streamsb.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/vid_mp4.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/we_transfer.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/wixmp.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/extractors/yt_mp4.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/mappers.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/provider.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/types.py (100%) rename {fastanime => viu}/libs/provider/anime/allanime/utils.py (97%) rename {fastanime => viu}/libs/provider/anime/animepahe/__init__.py (100%) rename {fastanime => viu}/libs/provider/anime/animepahe/constants.py (100%) rename {fastanime => viu}/libs/provider/anime/animepahe/extractor.py (100%) rename {fastanime => viu}/libs/provider/anime/animepahe/mappers.py (100%) rename {fastanime => viu}/libs/provider/anime/animepahe/provider.py (100%) rename {fastanime => viu}/libs/provider/anime/animepahe/types.py (100%) rename {fastanime => viu}/libs/provider/anime/base.py (100%) rename {fastanime => viu}/libs/provider/anime/params.py (100%) rename {fastanime => viu}/libs/provider/anime/provider.py (96%) rename {fastanime => viu}/libs/provider/anime/types.py (100%) rename {fastanime => viu}/libs/provider/anime/utils/debug.py (98%) rename {fastanime => viu}/libs/provider/manga/MangaProvider.py (97%) rename {fastanime => viu}/libs/provider/manga/__init__.py (100%) rename {fastanime => viu}/libs/provider/manga/base.py (100%) rename {fastanime => viu}/libs/provider/manga/common.py (100%) rename {fastanime => viu}/libs/provider/manga/mangadex/__init__.py (100%) rename {fastanime => viu}/libs/provider/manga/mangadex/api.py (100%) rename {fastanime => viu}/libs/provider/scraping/__init__.py (100%) rename {fastanime => viu}/libs/provider/scraping/html_parser.py (100%) rename {fastanime => viu}/libs/provider/scraping/user_agents.py (100%) rename {fastanime => viu}/libs/provider/scraping/utils.py (100%) rename {fastanime => viu}/libs/selectors/__init__.py (100%) rename {fastanime => viu}/libs/selectors/base.py (100%) rename {fastanime => viu}/libs/selectors/fzf/__init__.py (100%) rename {fastanime => viu}/libs/selectors/fzf/selector.py (97%) rename {fastanime => viu}/libs/selectors/inquirer/__init__.py (100%) rename {fastanime => viu}/libs/selectors/inquirer/selector.py (100%) rename {fastanime => viu}/libs/selectors/rofi/__init__.py (100%) rename {fastanime => viu}/libs/selectors/rofi/selector.py (100%) rename {fastanime => viu}/libs/selectors/selector.py (100%) rename fastanime/fastanime.py => viu/viu.py (92%) mode change 100755 => 100644 diff --git a/.github/chatmodes/new-command.chatmode.md b/.github/chatmodes/new-command.chatmode.md index 9012724..da8adc5 100644 --- a/.github/chatmodes/new-command.chatmode.md +++ b/.github/chatmodes/new-command.chatmode.md @@ -2,29 +2,29 @@ description: "Generate a new 'click' command following the project's lazy-loading pattern and service architecture." tools: ['codebase'] --- -# FastAnime: CLI Command Generation Mode +# viu: CLI Command Generation Mode -You are an expert on the `fastanime` CLI structure, which uses `click` and a custom `LazyGroup` for performance. Your task is to generate the boilerplate for a new command. +You are an expert on the `viu` CLI structure, which uses `click` and a custom `LazyGroup` for performance. Your task is to generate the boilerplate for a new command. -**First, ask the user if this is a top-level command (like `fastanime new-cmd`) or a subcommand (like `fastanime anilist new-sub-cmd`).** +**First, ask the user if this is a top-level command (like `viu new-cmd`) or a subcommand (like `viu anilist new-sub-cmd`).** --- ### If Top-Level Command: -1. **File Location:** State that the new command file should be created at: `fastanime/cli/commands/{command_name}.py`. +1. **File Location:** State that the new command file should be created at: `viu/cli/commands/{command_name}.py`. 2. **Boilerplate:** Generate the `click.command()` function. * It **must** accept `config: AppConfig` as the first argument using `@click.pass_obj`. - * It **must not** contain business logic. Instead, show how to instantiate a service from `fastanime.cli.service` and call its methods. -3. **Registration:** Instruct the user to register the command by adding it to the `commands` dictionary in `fastanime/cli/cli.py`. Provide the exact line to add, like: `"new-cmd": "new_cmd.new_cmd_function"`. + * It **must not** contain business logic. Instead, show how to instantiate a service from `viu.cli.service` and call its methods. +3. **Registration:** Instruct the user to register the command by adding it to the `commands` dictionary in `viu/cli/cli.py`. Provide the exact line to add, like: `"new-cmd": "new_cmd.new_cmd_function"`. --- ### If Subcommand: 1. **Ask for Parent:** Ask for the parent command group (e.g., `anilist`, `registry`). -2. **File Location:** State that the new command file should be created at: `fastanime/cli/commands/{parent_name}/commands/{command_name}.py`. +2. **File Location:** State that the new command file should be created at: `viu/cli/commands/{parent_name}/commands/{command_name}.py`. 3. **Boilerplate:** Generate the `click.command()` function, similar to the top-level command. -4. **Registration:** Instruct the user to register the subcommand in the parent's `cmd.py` file (e.g., `fastanime/cli/commands/anilist/cmd.py`) by adding it to the `lazy_subcommands` dictionary within the `@click.group` decorator. +4. **Registration:** Instruct the user to register the subcommand in the parent's `cmd.py` file (e.g., `viu/cli/commands/anilist/cmd.py`) by adding it to the `lazy_subcommands` dictionary within the `@click.group` decorator. -**Final Instruction:** Remind the user that if the command introduces new logic, it should be encapsulated in a new or existing **Service** class in the `fastanime/cli/service/` directory. The CLI command function should only handle argument parsing and calling the service. +**Final Instruction:** Remind the user that if the command introduces new logic, it should be encapsulated in a new or existing **Service** class in the `viu/cli/service/` directory. The CLI command function should only handle argument parsing and calling the service. diff --git a/.github/chatmodes/new-component.chatmode.md b/.github/chatmodes/new-component.chatmode.md index f6206e9..194c5c6 100644 --- a/.github/chatmodes/new-component.chatmode.md +++ b/.github/chatmodes/new-component.chatmode.md @@ -2,9 +2,9 @@ description: "Scaffold the necessary files and code for a new Player or Selector component, including configuration." tools: ['codebase', 'search'] --- -# FastAnime: New Component Generation Mode +# viu: New Component Generation Mode -You are an expert on `fastanime`'s modular architecture. Your task is to help the developer add a new **Player** or **Selector** component. +You are an expert on `viu`'s modular architecture. Your task is to help the developer add a new **Player** or **Selector** component. **First, ask the user whether they want to create a 'Player' or a 'Selector'.** Then, follow the appropriate path below. @@ -12,13 +12,13 @@ You are an expert on `fastanime`'s modular architecture. Your task is to help th ### If the user chooses 'Player': -1. **Scaffold Directory:** Create a directory at `fastanime/libs/player/{player_name}/`. -2. **Implement `BasePlayer`:** Create a `player.py` file with a class `NewPlayer` that inherits from `fastanime.libs.player.base.BasePlayer`. Implement the `play` and `play_with_ipc` methods. The `play` method should use `subprocess` to call the player's executable. +1. **Scaffold Directory:** Create a directory at `viu/libs/player/{player_name}/`. +2. **Implement `BasePlayer`:** Create a `player.py` file with a class `NewPlayer` that inherits from `viu.libs.player.base.BasePlayer`. Implement the `play` and `play_with_ipc` methods. The `play` method should use `subprocess` to call the player's executable. 3. **Add Configuration:** - * Instruct to create a new Pydantic model `NewPlayerConfig(OtherConfig)` in `fastanime/core/config/model.py`. + * Instruct to create a new Pydantic model `NewPlayerConfig(OtherConfig)` in `viu/core/config/model.py`. * Add the new config model to the main `AppConfig`. - * Add defaults in `fastanime/core/config/defaults.py` and descriptions in `fastanime/core/config/descriptions.py`. -4. **Register Player:** Instruct to modify `fastanime/libs/player/player.py` by: + * Add defaults in `viu/core/config/defaults.py` and descriptions in `viu/core/config/descriptions.py`. +4. **Register Player:** Instruct to modify `viu/libs/player/player.py` by: * Adding the player name to the `PLAYERS` list. * Adding the instantiation logic to the `PlayerFactory.create` method. @@ -26,9 +26,9 @@ You are an expert on `fastanime`'s modular architecture. Your task is to help th ### If the user chooses 'Selector': -1. **Scaffold Directory:** Create a directory at `fastanime/libs/selectors/{selector_name}/`. -2. **Implement `BaseSelector`:** Create a `selector.py` file with a class `NewSelector` that inherits from `fastanime.libs.selectors.base.BaseSelector`. Implement the `choose`, `confirm`, and `ask` methods. +1. **Scaffold Directory:** Create a directory at `viu/libs/selectors/{selector_name}/`. +2. **Implement `BaseSelector`:** Create a `selector.py` file with a class `NewSelector` that inherits from `viu.libs.selectors.base.BaseSelector`. Implement the `choose`, `confirm`, and `ask` methods. 3. **Add Configuration:** (Follow the same steps as for a Player). 4. **Register Selector:** - * Instruct to modify `fastanime/libs/selectors/selector.py` by adding the selector name to the `SELECTORS` list and the factory logic to `SelectorFactory.create`. - * Instruct to update the `Literal` type hint for the `selector` field in `GeneralConfig` (`fastanime/core/config/model.py`). + * Instruct to modify `viu/libs/selectors/selector.py` by adding the selector name to the `SELECTORS` list and the factory logic to `SelectorFactory.create`. + * Instruct to update the `Literal` type hint for the `selector` field in `GeneralConfig` (`viu/core/config/model.py`). diff --git a/.github/chatmodes/new-provider.chatmode.md b/.github/chatmodes/new-provider.chatmode.md index 4eaf856..1dd6c56 100644 --- a/.github/chatmodes/new-provider.chatmode.md +++ b/.github/chatmodes/new-provider.chatmode.md @@ -1,27 +1,27 @@ --- -description: "Scaffold and implement a new anime provider, following all architectural patterns of the fastanime project." +description: "Scaffold and implement a new anime provider, following all architectural patterns of the viu project." tools: ['codebase', 'search', 'fetch'] --- -# FastAnime: New Provider Generation Mode +# viu: New Provider Generation Mode -You are an expert on the `fastanime` codebase, specializing in its provider architecture. Your task is to guide the developer in creating a new anime provider. You must strictly adhere to the project's structure and coding conventions. +You are an expert on the `viu` codebase, specializing in its provider architecture. Your task is to guide the developer in creating a new anime provider. You must strictly adhere to the project's structure and coding conventions. **Your process is as follows:** 1. **Ask for the Provider's Name:** First, ask the user for the name of the new provider (e.g., `gogoanime`, `crunchyroll`). Use this name (in lowercase) for all subsequent file and directory naming. 2. **Scaffold the Directory Structure:** Based on the name, state the required directory structure that needs to be created: - `fastanime/libs/provider/anime/{provider_name}/` + `viu/libs/provider/anime/{provider_name}/` 3. **Scaffold the Core Files:** Generate the initial code for the following files inside the new directory. Ensure all code is fully type-hinted. * **`__init__.py`**: Can be an empty file. * **`types.py`**: Create placeholder `TypedDict` models for the provider's specific API responses (e.g., `GogoAnimeSearchResult`, `GogoAnimeEpisode`). - * **`mappers.py`**: Create empty mapping functions that will convert the provider-specific types into the generic types from `fastanime.libs.provider.anime.types`. For example: `map_to_search_results(data: GogoAnimeSearchPage) -> SearchResults:`. - * **`provider.py`**: Generate the main provider class. It **MUST** inherit from `fastanime.libs.provider.anime.base.BaseAnimeProvider`. Include stubs for the required abstract methods: `search`, `get`, and `episode_streams`. Remind the user to use `httpx.Client` for requests and to call the mapper functions. + * **`mappers.py`**: Create empty mapping functions that will convert the provider-specific types into the generic types from `viu.libs.provider.anime.types`. For example: `map_to_search_results(data: GogoAnimeSearchPage) -> SearchResults:`. + * **`provider.py`**: Generate the main provider class. It **MUST** inherit from `viu.libs.provider.anime.base.BaseAnimeProvider`. Include stubs for the required abstract methods: `search`, `get`, and `episode_streams`. Remind the user to use `httpx.Client` for requests and to call the mapper functions. 4. **Instruct on Registration:** Clearly state the two files that **must** be modified to register the new provider: - * **`fastanime/libs/provider/anime/types.py`**: Add the new provider's name to the `ProviderName` enum. - * **`fastanime/libs/provider/anime/provider.py`**: Add an entry to the `PROVIDERS_AVAILABLE` dictionary. + * **`viu/libs/provider/anime/types.py`**: Add the new provider's name to the `ProviderName` enum. + * **`viu/libs/provider/anime/provider.py`**: Add an entry to the `PROVIDERS_AVAILABLE` dictionary. -5. **Final Guidance:** Remind the developer to add any title normalization rules to `fastanime/assets/normalizer.json` if the provider uses different anime titles than AniList. +5. **Final Guidance:** Remind the developer to add any title normalization rules to `viu/assets/normalizer.json` if the provider uses different anime titles than AniList. diff --git a/.github/chatmodes/plan.chatmode.md b/.github/chatmodes/plan.chatmode.md index fbc9733..534dd6c 100644 --- a/.github/chatmodes/plan.chatmode.md +++ b/.github/chatmodes/plan.chatmode.md @@ -1,11 +1,11 @@ --- -description: "Plan new features or bug fixes with architectural guidance for the fastanime project. Does not write implementation code." +description: "Plan new features or bug fixes with architectural guidance for the viu project. Does not write implementation code." tools: ['codebase', 'search', 'githubRepo', 'fetch'] model: "gpt-4o" --- -# FastAnime: Feature & Fix Planner Mode +# viu: Feature & Fix Planner Mode -You are a senior software architect and project planner for the `fastanime` project. You are an expert in its layered architecture (`Core`, `Libs`, `Service`, `CLI`) and its commitment to modular, testable code. +You are a senior software architect and project planner for the `viu` project. You are an expert in its layered architecture (`Core`, `Libs`, `Service`, `CLI`) and its commitment to modular, testable code. Your primary goal is to help the user break down a feature request or bug report into a clear, actionable implementation plan. @@ -33,17 +33,17 @@ Your primary goal is to help the user break down a feature request or bug report **2. Architectural Impact Analysis** > This is the most important section. Detail which parts of the codebase will be touched and why. -> - **Core Layer (`fastanime/core`):** +> - **Core Layer (`viu/core`):** > - *Config (`config/model.py`):* Will a new Pydantic model or field be needed? > - *Utils (`utils/`):* Are any new low-level, reusable functions required? > - *Exceptions (`exceptions.py`):* Does this introduce a new failure case that needs a custom exception? -> - **Libs Layer (`fastanime/libs`):** +> - **Libs Layer (`viu/libs`):** > - *Media API (`media_api/`):* Does this involve a new call to the AniList API? > - *Provider (`provider/`):* Does this affect how data is scraped? > - *Player/Selector (`player/`, `selectors/`):* Does this change how we interact with external tools? -> - **Service Layer (`fastanime/cli/service`):** +> - **Service Layer (`viu/cli/service`):** > - Which service will orchestrate this logic? (e.g., `DownloadService`, `PlayerService`). Will a new service be needed? -> - **CLI Layer (`fastanime/cli`):** +> - **CLI Layer (`viu/cli`):** > - *Commands (`commands/`):* Which `click` command(s) will expose this feature? > - *Interactive UI (`interactive/`):* Which TUI menu(s) need to be added or modified? @@ -52,7 +52,7 @@ Your primary goal is to help the user break down a feature request or bug report > 1. [ ] **Config:** Add `new_setting` to `GeneralConfig` in `core/config/model.py`. > 2. [ ] **Core:** Implement `new_util()` in `core/utils/helpers.py`. > 3. [ ] **Service:** Add method `handle_new_feature()` to `MyService`. -> 4. [ ] **CLI:** Add `--new-feature` option to the `fastanime anilist search` command. +> 4. [ ] **CLI:** Add `--new-feature` option to the `viu anilist search` command. > 5. [ ] **Tests:** Write a unit test for `new_util()` and an integration test for the service method. **4. Configuration Changes** diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f95e5eb..12414b4 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,27 +1,27 @@ -# GitHub Copilot Instructions for the FastAnime Repository +# GitHub Copilot Instructions for the viu Repository -Hello, Copilot! This document provides instructions and context to help you understand the `fastanime` codebase. Following these guidelines will help you generate code that is consistent, maintainable, and aligned with the project's architecture. +Hello, Copilot! This document provides instructions and context to help you understand the `viu` codebase. Following these guidelines will help you generate code that is consistent, maintainable, and aligned with the project's architecture. ## 1. High-Level Project Goal -`fastanime` is a command-line tool that brings the anime browsing, streaming, and management experience to the terminal. It integrates with metadata providers like AniList and scrapes streaming links from various anime provider websites. The core goals are efficiency, extensibility, and providing a powerful, scriptable user experience. +`viu` is a command-line tool that brings the anime browsing, streaming, and management experience to the terminal. It integrates with metadata providers like AniList and scrapes streaming links from various anime provider websites. The core goals are efficiency, extensibility, and providing a powerful, scriptable user experience. ## 2. Core Architectural Concepts The project follows a clean, layered architecture. When generating code, please adhere to this structure. -#### Layer 1: CLI (`fastanime/cli`) +#### Layer 1: CLI (`viu/cli`) * **Purpose:** Handles user interaction, command parsing, and displaying output. * **Key Libraries:** `click` for command structure, `rich` for styled output. -* **Interactive Mode:** The interactive TUI is managed by the `Session` object in `fastanime/cli/interactive/session.py`. It's a state machine where each menu is a function that returns the next `State` or an `InternalDirective` (like `BACK` or `EXIT`). +* **Interactive Mode:** The interactive TUI is managed by the `Session` object in `viu/cli/interactive/session.py`. It's a state machine where each menu is a function that returns the next `State` or an `InternalDirective` (like `BACK` or `EXIT`). * **Guideline:** **CLI files should not contain complex business logic.** They should parse arguments and delegate tasks to the Service Layer. -#### Layer 2: Service (`fastanime/cli/service`) +#### Layer 2: Service (`viu/cli/service`) * **Purpose:** Contains the core application logic. Services act as orchestrators, connecting the CLI layer with the various library components. * **Examples:** `DownloadService`, `PlayerService`, `MediaRegistryService`, `WatchHistoryService`. * **Guideline:** When adding new functionality (e.g., a new way to manage downloads), it should likely be implemented in a service or an existing service should be extended. Services are the "brains" of the application. -#### Layer 3: Libraries (`fastanime/libs`) +#### Layer 3: Libraries (`viu/libs`) * **Purpose:** A collection of independent, reusable modules with well-defined contracts (Abstract Base Classes). * **`media_api`:** Interfaces with metadata services like AniList. All new metadata clients **must** inherit from `BaseApiClient`. * **`provider`:** Interfaces with anime streaming websites. All new providers **must** inherit from `BaseAnimeProvider`. @@ -29,7 +29,7 @@ The project follows a clean, layered architecture. When generating code, please * **`selectors`:** Wrappers for interactive UI tools like FZF or Rofi. All new selectors **must** inherit from `BaseSelector`. * **Guideline:** Libraries should be self-contained and not depend on the CLI or Service layers. They receive configuration and perform their specific task. -#### Layer 4: Core (`fastanime/core`) +#### Layer 4: Core (`viu/core`) * **Purpose:** Foundational code shared across the entire application. * **`config`:** Pydantic models defining the application's configuration structure. **This is the single source of truth for all settings.** * **`downloader`:** The underlying logic for downloading files (using `yt-dlp` or `httpx`). @@ -39,7 +39,7 @@ The project follows a clean, layered architecture. When generating code, please ## 3. Key Technologies * **Dependency Management:** `uv` is used for all package management and task running. Refer to `pyproject.toml` for dependencies. -* **Configuration:** **Pydantic** is used exclusively. The entire configuration is defined in `fastanime/core/config/model.py`. +* **Configuration:** **Pydantic** is used exclusively. The entire configuration is defined in `viu/core/config/model.py`. * **CLI Framework:** `click`. We use a custom `LazyGroup` to load commands on demand for faster startup. * **HTTP Client:** `httpx` is the standard for all network requests. @@ -48,37 +48,37 @@ The project follows a clean, layered architecture. When generating code, please Follow these patterns to ensure your contributions fit the existing architecture. ### How to Add a New Provider -1. **Create Directory:** Add a new folder in `fastanime/libs/provider/anime/newprovider/`. +1. **Create Directory:** Add a new folder in `viu/libs/provider/anime/newprovider/`. 2. **Implement `BaseAnimeProvider`:** In `provider.py`, create a class `NewProvider` that inherits from `BaseAnimeProvider` and implement the `search`, `get`, and `episode_streams` methods. -3. **Create Mappers:** In `mappers.py`, write functions to convert the provider's API/HTML data into the generic Pydantic models from `fastanime/libs/provider/anime/types.py` (e.g., `SearchResult`, `Anime`, `Server`). +3. **Create Mappers:** In `mappers.py`, write functions to convert the provider's API/HTML data into the generic Pydantic models from `viu/libs/provider/anime/types.py` (e.g., `SearchResult`, `Anime`, `Server`). 4. **Register Provider:** - * Add the provider's name to the `ProviderName` enum in `fastanime/libs/provider/anime/types.py`. - * Add it to the `PROVIDERS_AVAILABLE` dictionary in `fastanime/libs/provider/anime/provider.py`. + * Add the provider's name to the `ProviderName` enum in `viu/libs/provider/anime/types.py`. + * Add it to the `PROVIDERS_AVAILABLE` dictionary in `viu/libs/provider/anime/provider.py`. ### How to Add a New Player -1. **Create Directory:** Add a new folder in `fastanime/libs/player/newplayer/`. +1. **Create Directory:** Add a new folder in `viu/libs/player/newplayer/`. 2. **Implement `BasePlayer`:** In `player.py`, create a class `NewPlayer` that inherits from `BasePlayer` and implement the `play` method. It should call the player's executable via `subprocess`. -3. **Add Configuration:** If the player has settings, add a `NewPlayerConfig` Pydantic model in `fastanime/core/config/model.py`, and add it to the main `AppConfig`. Also add defaults and descriptions. -4. **Register Player:** Add the player's name to the `PLAYERS` list and the factory logic in `fastanime/libs/player/player.py`. +3. **Add Configuration:** If the player has settings, add a `NewPlayerConfig` Pydantic model in `viu/core/config/model.py`, and add it to the main `AppConfig`. Also add defaults and descriptions. +4. **Register Player:** Add the player's name to the `PLAYERS` list and the factory logic in `viu/libs/player/player.py`. ### How to Add a New Selector -1. **Create Directory:** Add a new folder in `fastanime/libs/selectors/newselector/`. +1. **Create Directory:** Add a new folder in `viu/libs/selectors/newselector/`. 2. **Implement `BaseSelector`:** In `selector.py`, create a class `NewSelector` that inherits from `BaseSelector` and implement `choose`, `confirm`, and `ask`. -3. **Add Configuration:** If needed, add a `NewSelectorConfig` to `fastanime/core/config/model.py`. -4. **Register Selector:** Add the selector's name to the `SELECTORS` list and the factory logic in `fastanime/libs/selectors/selector.py`. Update the `Literal` type hint for `selector` in `GeneralConfig`. +3. **Add Configuration:** If needed, add a `NewSelectorConfig` to `viu/core/config/model.py`. +4. **Register Selector:** Add the selector's name to the `SELECTORS` list and the factory logic in `viu/libs/selectors/selector.py`. Update the `Literal` type hint for `selector` in `GeneralConfig`. ### How to Add a New CLI Command -* **Top-Level Command (`fastanime my-command`):** - 1. Create `fastanime/cli/commands/my_command.py` with your `click.command()`. - 2. Register it in the `commands` dictionary in `fastanime/cli/cli.py`. -* **Subcommand (`fastanime anilist my-subcommand`):** - 1. Create `fastanime/cli/commands/anilist/commands/my_subcommand.py`. - 2. Register it in the `lazy_subcommands` dictionary of the parent `click.group()` (e.g., in `fastanime/cli/commands/anilist/cmd.py`). +* **Top-Level Command (`viu my-command`):** + 1. Create `viu/cli/commands/my_command.py` with your `click.command()`. + 2. Register it in the `commands` dictionary in `viu/cli/cli.py`. +* **Subcommand (`viu anilist my-subcommand`):** + 1. Create `viu/cli/commands/anilist/commands/my_subcommand.py`. + 2. Register it in the `lazy_subcommands` dictionary of the parent `click.group()` (e.g., in `viu/cli/commands/anilist/cmd.py`). ### How to Add a New Configuration Option -1. **Add to Model:** Add the field to the appropriate Pydantic model in `fastanime/core/config/model.py`. -2. **Add Default:** Add a default value in `fastanime/core/config/defaults.py`. -3. **Add Description:** Add a user-friendly description in `fastanime/core/config/descriptions.py`. +1. **Add to Model:** Add the field to the appropriate Pydantic model in `viu/core/config/model.py`. +2. **Add Default:** Add a default value in `viu/core/config/defaults.py`. +3. **Add Description:** Add a user-friendly description in `viu/core/config/descriptions.py`. 4. The config loader and CLI option generation will handle the rest automatically. ## 5. Code Style and Conventions @@ -91,7 +91,7 @@ Follow these patterns to ensure your contributions fit the existing architecture * ✅ **DO** use the abstract base classes (`BaseProvider`, `BasePlayer`, etc.) as contracts. * ✅ **DO** place business logic in the `service` layer. -* ✅ **DO** use the Pydantic models in `fastanime/core/config/model.py` as the single source of truth for configuration. +* ✅ **DO** use the Pydantic models in `viu/core/config/model.py` as the single source of truth for configuration. * ✅ **DO** use the `Context` object in interactive menus to access services and configuration. * ❌ **DON'T** hardcode configuration values. Access them via the `config` object. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 871e86d..aef90c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,13 +20,13 @@ jobs: with: enable-cache: true - - name: Build fastanime + - name: Build viu run: uv build - name: Archive production artifacts uses: actions/upload-artifact@v4 with: - name: fastanime_debug_build + name: viu_debug_build path: | dist diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1b43d70..2032941 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,12 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# GitHub recommends pinning actions to a commit SHA. -# To get a newer version, you will need to update the SHA. -# You can also reference a tag or branch, but the action may change without warning. - name: Upload Python Package on: @@ -32,7 +23,7 @@ jobs: with: enable-cache: true - - name: Build fastanime + - name: Build viu run: uv build - name: Upload distributions diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md index 1bb8de7..835f80a 100644 --- a/CONTRIBUTIONS.md +++ b/CONTRIBUTIONS.md @@ -1,29 +1,29 @@ -# Contributing to FastAnime +# Contributing to Viu -First off, thank you for considering contributing to FastAnime! We welcome any help, whether it's reporting a bug, proposing a feature, or writing code. This document will guide you through the process. +First off, thank you for considering contributing to Viu! We welcome any help, whether it's reporting a bug, proposing a feature, or writing code. This document will guide you through the process. ## How Can I Contribute? -There are many ways to contribute to the FastAnime project: +There are many ways to contribute to the Viu project: -* **Reporting Bugs:** If you find a bug, please create an issue in our [issue tracker](https://github.com/Benexl/FastAnime/issues). +* **Reporting Bugs:** If you find a bug, please create an issue in our [issue tracker](https://github.com/Benexl/Viu/issues). * **Suggesting Enhancements:** Have an idea for a new feature or an improvement to an existing one? We'd love to hear it. * **Writing Code:** Help us fix bugs or implement new features. * **Improving Documentation:** Enhance our README, add examples, or clarify our contribution guidelines. -* **Adding a Provider, Player, or Selector:** Extend FastAnime's capabilities by integrating new tools and services. +* **Adding a Provider, Player, or Selector:** Extend Viu's capabilities by integrating new tools and services. ## Contribution Workflow We follow the standard GitHub Fork & Pull Request workflow. -1. **Create an Issue:** Before starting work on a new feature or a significant bug fix, please [create an issue](https://github.com/Benexl/FastAnime/issues/new/choose) to discuss your idea. This allows us to give feedback and prevent duplicate work. For small bugs or documentation typos, you can skip this step. +1. **Create an Issue:** Before starting work on a new feature or a significant bug fix, please [create an issue](https://github.com/Benexl/Viu/issues/new/choose) to discuss your idea. This allows us to give feedback and prevent duplicate work. For small bugs or documentation typos, you can skip this step. -2. **Fork the Repository:** Create your own fork of the FastAnime repository. +2. **Fork the Repository:** Create your own fork of the Viu repository. 3. **Clone Your Fork:** ```bash - git clone https://github.com/YOUR_USERNAME/FastAnime.git - cd FastAnime + git clone https://github.com/YOUR_USERNAME/Viu.git + cd Viu ``` 4. **Create a Branch:** Create a new branch for your changes. Use a descriptive name. @@ -64,7 +64,7 @@ We follow the standard GitHub Fork & Pull Request workflow. git push origin feat/my-new-feature ``` -9. **Submit a Pull Request:** Open a pull request from your branch to the `master` branch of the main FastAnime repository. Provide a clear title and description of your changes. +9. **Submit a Pull Request:** Open a pull request from your branch to the `master` branch of the main Viu repository. Provide a clear title and description of your changes. ## Setting Up Your Development Environment @@ -111,7 +111,7 @@ To maintain code quality and consistency, please adhere to the following guideli * **Modularity and Architecture:** * **Services:** Business logic is organized into services (e.g., `PlayerService`, `DownloadService`). * **Factories:** Use factory patterns (`create_provider`, `create_selector`) for creating instances of different implementations. - * **Configuration:** All configuration is managed through Pydantic models in `fastanime/core/config/model.py`. When adding new config options, update the model, defaults, and descriptions. + * **Configuration:** All configuration is managed through Pydantic models in `viu/core/config/model.py`. When adding new config options, update the model, defaults, and descriptions. * **Commit Messages:** Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. * **Testing:** New features should be accompanied by tests. Bug fixes should ideally include a regression test. @@ -119,25 +119,25 @@ To maintain code quality and consistency, please adhere to the following guideli Adding a new anime provider is a great way to contribute. Here are the steps: -1. **Create a New Provider Directory:** Inside `fastanime/libs/provider/anime/`, create a new directory with the provider's name (e.g., `fastanime/libs/provider/anime/newprovider/`). +1. **Create a New Provider Directory:** Inside `viu/libs/provider/anime/`, create a new directory with the provider's name (e.g., `viu/libs/provider/anime/newprovider/`). 2. **Implement the Provider:** * Create a `provider.py` file. * Define a class (e.g., `NewProviderApi`) that inherits from `BaseAnimeProvider`. * Implement the abstract methods: `search`, `get`, and `episode_streams`. - * Create `mappers.py` to convert the provider's data structures into the generic types defined in `fastanime/libs/provider/anime/types.py`. + * Create `mappers.py` to convert the provider's data structures into the generic types defined in `viu/libs/provider/anime/types.py`. * Create `types.py` for any provider-specific data structures you need. * If the provider requires complex scraping, place extractor logic in an `extractors/` subdirectory. 3. **Register the Provider:** - * Add your new provider to the `ProviderName` enum in `fastanime/libs/provider/anime/types.py`. - * Register it in the `PROVIDERS_AVAILABLE` dictionary in `fastanime/libs/provider/anime/provider.py`. + * Add your new provider to the `ProviderName` enum in `viu/libs/provider/anime/types.py`. + * Register it in the `PROVIDERS_AVAILABLE` dictionary in `viu/libs/provider/anime/provider.py`. -4. **Add Normalization Rules (Optional):** If the provider uses different anime titles than AniList, add mappings to `fastanime/assets/normalizer.json`. +4. **Add Normalization Rules (Optional):** If the provider uses different anime titles than AniList, add mappings to `viu/assets/normalizer.json`. ## How to Add a New Player -1. **Create a New Player Directory:** Inside `fastanime/libs/player/`, create a directory for your player (e.g., `fastanime/libs/player/myplayer/`). +1. **Create a New Player Directory:** Inside `viu/libs/player/`, create a directory for your player (e.g., `viu/libs/player/myplayer/`). 2. **Implement the Player Class:** * In `myplayer/player.py`, create a class (e.g., `MyPlayer`) that inherits from `BasePlayer`. @@ -145,17 +145,17 @@ Adding a new anime provider is a great way to contribute. Here are the steps: * The `play` method should handle launching the player as a subprocess and return a `PlayerResult`. 3. **Add Configuration (if needed):** - * If your player has configurable options, add a new Pydantic model (e.g., `MyPlayerConfig`) in `fastanime/core/config/model.py`. It should inherit from `OtherConfig`. + * If your player has configurable options, add a new Pydantic model (e.g., `MyPlayerConfig`) in `viu/core/config/model.py`. It should inherit from `OtherConfig`. * Add this new config model as a field in the main `AppConfig` model. * Add default values in `defaults.py` and descriptions in `descriptions.py`. 4. **Register the Player:** - * Add your player's name to the `PLAYERS` list in `fastanime/libs/player/player.py`. + * Add your player's name to the `PLAYERS` list in `viu/libs/player/player.py`. * Add the logic to instantiate your player class within the `PlayerFactory.create` method. ## How to Add a New Selector -1. **Create a New Selector Directory:** Inside `fastanime/libs/selectors/`, create a new directory (e.g., `fastanime/libs/selectors/myselector/`). +1. **Create a New Selector Directory:** Inside `viu/libs/selectors/`, create a new directory (e.g., `viu/libs/selectors/myselector/`). 2. **Implement the Selector Class:** * In `myselector/selector.py`, create a class (e.g., `MySelector`) that inherits from `BaseSelector`. @@ -165,19 +165,19 @@ Adding a new anime provider is a great way to contribute. Here are the steps: 3. **Add Configuration (if needed):** Follow the same configuration steps as for adding a new player. 4. **Register the Selector:** - * Add your selector's name to the `SELECTORS` list in `fastanime/libs/selectors/selector.py`. + * Add your selector's name to the `SELECTORS` list in `viu/libs/selectors/selector.py`. * Add the instantiation logic to the `SelectorFactory.create` method. - * Update the `Literal` type hint for the `selector` field in `GeneralConfig` (`fastanime/core/config/model.py`). + * Update the `Literal` type hint for the `selector` field in `GeneralConfig` (`viu/core/config/model.py`). ## How to Add a New CLI Command or Service Our CLI uses `click` and a `LazyGroup` class to load commands on demand. -### Adding a Top-Level Command (e.g., `fastanime my-command`) +### Adding a Top-Level Command (e.g., `viu my-command`) -1. **Create the Command File:** Create a new Python file in `fastanime/cli/commands/` (e.g., `my_command.py`). This file should contain your `click.command()` function. +1. **Create the Command File:** Create a new Python file in `viu/cli/commands/` (e.g., `my_command.py`). This file should contain your `click.command()` function. -2. **Register the Command:** In `fastanime/cli/cli.py`, add your command to the `commands` dictionary. +2. **Register the Command:** In `viu/cli/cli.py`, add your command to the `commands` dictionary. ```python commands = { # ... existing commands @@ -185,11 +185,11 @@ Our CLI uses `click` and a `LazyGroup` class to load commands on demand. } ``` -### Adding a Subcommand (e.g., `fastanime anilist my-subcommand`) +### Adding a Subcommand (e.g., `viu anilist my-subcommand`) -1. **Create the Command File:** Place your new command file inside the appropriate subdirectory, for example, `fastanime/cli/commands/anilist/commands/my_subcommand.py`. +1. **Create the Command File:** Place your new command file inside the appropriate subdirectory, for example, `viu/cli/commands/anilist/commands/my_subcommand.py`. -2. **Register the Subcommand:** In the parent command's entry point file (e.g., `fastanime/cli/commands/anilist/cmd.py`), add your subcommand to the `commands` dictionary within the `LazyGroup`. +2. **Register the Subcommand:** In the parent command's entry point file (e.g., `viu/cli/commands/anilist/cmd.py`), add your subcommand to the `commands` dictionary within the `LazyGroup`. ```python @click.group( cls=LazyGroup, @@ -202,7 +202,7 @@ Our CLI uses `click` and a `LazyGroup` class to load commands on demand. ``` ### Creating a Service -If your command involves complex logic, consider creating a service in `fastanime/cli/service/` to keep the business logic separate from the command-line interface. This service can then be instantiated and used within your `click` command function. This follows the existing pattern for services like `DownloadService` and `PlayerService`. +If your command involves complex logic, consider creating a service in `viu/cli/service/` to keep the business logic separate from the command-line interface. This service can then be instantiated and used within your `click` command function. This follows the existing pattern for services like `DownloadService` and `PlayerService`. --- -Thank you for contributing to FastAnime +Thank you for contributing to Viu diff --git a/DISCLAIMER.md b/DISCLAIMER.md index e28478d..e7515bf 100644 --- a/DISCLAIMER.md +++ b/DISCLAIMER.md @@ -2,7 +2,7 @@
-

This project: fastanime

+

This project: viu


diff --git a/README.md b/README.md index eda2e40..6193510 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

-

FastAnime

+

Viu

@@ -8,12 +8,12 @@

-[![PyPI - Version](https://img.shields.io/pypi/v/fastanime)](https://pypi.org/project/fastanime/) -[![PyPI - Downloads](https://img.shields.io/pypi/dm/fastanime)](https://pypi.org/project/fastanime/) -[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Benexl/FastAnime/test.yml?label=Tests)](https://github.com/Benexl/FastAnime/actions) +[![PyPI - Version](https://img.shields.io/pypi/v/viu)](https://pypi.org/project/viu/) +[![PyPI - Downloads](https://img.shields.io/pypi/dm/viu)](https://pypi.org/project/viu/) +[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Benexl/Viu/test.yml?label=Tests)](https://github.com/Benexl/Viu/actions) [![Discord](https://img.shields.io/discord/1250887070906323096?label=Discord&logo=discord)](https://discord.gg/HBEmAwvbHV) -[![GitHub Issues](https://img.shields.io/github/issues/Benexl/FastAnime)](https://github.com/Benexl/FastAnime/issues) -[![PyPI - License](https://img.shields.io/pypi/l/fastanime)](https://github.com/Benexl/FastAnime/blob/master/LICENSE) +[![GitHub Issues](https://img.shields.io/github/issues/Benexl/Viu)](https://github.com/Benexl/Viu/issues) +[![PyPI - License](https://img.shields.io/pypi/l/viu)](https://github.com/Benexl/Viu/blob/master/LICENSE)
@@ -23,7 +23,7 @@

-![fastanime](https://github.com/user-attachments/assets/9ab09f26-e4a8-4b70-a315-7def998cec63) +![viu](https://github.com/user-attachments/assets/9ab09f26-e4a8-4b70-a315-7def998cec63)
@@ -77,7 +77,7 @@ ## Installation -FastAnime runs on any platform with Python 3.10+, including Windows, macOS, Linux, and Android (via Termux). +Viu runs on any platform with Python 3.10+, including Windows, macOS, Linux, and Android (via Termux). ### Prerequisites @@ -94,17 +94,17 @@ For the best experience, please install these external tools: ### Recommended Installation (uv) -The best way to install FastAnime is with [**uv**](https://github.com/astral-sh/uv), a lightning-fast Python package manager. +The best way to install Viu is with [**uv**](https://github.com/astral-sh/uv), a lightning-fast Python package manager. ```bash # Install with all optional features for the full experience -uv tool install "fastanime[standard]" +uv tool install "viu[standard]" # Or, pick and choose the extras you need: -uv tool install fastanime # Core functionality only -uv tool install "fastanime[download]" # For advanced downloading with yt-dlp -uv tool install "fastanime[discord]" # For Discord Rich Presence -uv tool install "fastanime[notifications]" # For desktop notifications +uv tool install viu # Core functionality only +uv tool install "viu[download]" # For advanced downloading with yt-dlp +uv tool install "viu[discord]" # For Discord Rich Presence +uv tool install "viu[notifications]" # For desktop notifications ``` ### Other Installation Methods @@ -114,27 +114,27 @@ uv tool install "fastanime[notifications]" # For desktop notifications #### Nix / NixOS ```bash - nix profile install github:Benexl/fastanime + nix profile install github:Benexl/viu ``` #### Arch Linux (AUR) Use an AUR helper like `yay` or `paru`. ```bash # Stable version (recommended) - yay -S fastanime + yay -S viu # Git version (latest commit) - yay -S fastanime-git + yay -S viu-git ``` #### Using pipx (for isolated environments) ```bash - pipx install "fastanime[standard]" + pipx install "viu[standard]" ``` #### Using pip ```bash - pip install "fastanime[standard]" + pip install "viu[standard]" ```
@@ -143,15 +143,15 @@ uv tool install "fastanime[notifications]" # For desktop notifications Requires [Git](https://git-scm.com/), [Python 3.10+](https://www.python.org/), and [uv](https://astral.sh/blog/uv). ```bash - git clone https://github.com/Benexl/FastAnime.git --depth 1 - cd FastAnime + git clone https://github.com/Benexl/Viu.git --depth 1 + cd Viu uv tool install . - fastanime --version + viu --version ``` > [!TIP] -> Enable shell completions for a much better experience by running `fastanime completions` and following the on-screen instructions for your shell. +> Enable shell completions for a much better experience by running `viu completions` and following the on-screen instructions for your shell. ## Getting Started: Quick Start @@ -159,59 +159,59 @@ Get up and running in three simple steps: 1. **Authenticate with AniList:** ```bash - fastanime anilist auth + viu anilist auth ``` This will open your browser. Authorize the app and paste the obtained token back into the terminal. 2. **Launch the Interactive TUI:** ```bash - fastanime anilist + viu anilist ``` 3. **Browse & Play:** Use your arrow keys to navigate the menus, select an anime, and choose an episode to stream instantly. ## Usage Guide -### The Interactive TUI (`fastanime anilist`) +### The Interactive TUI (`viu anilist`) -This is the main, user-friendly way to use FastAnime. It provides a rich terminal experience where you can: +This is the main, user-friendly way to use Viu. It provides a rich terminal experience where you can: * Browse trending, popular, and seasonal anime. * Manage your personal lists (Watching, Completed, Paused, etc.). * Search for any anime in the AniList database. * View detailed information, characters, recommendations, reviews, and airing schedules. * Stream or download episodes directly from the menus. -### Powerful Searching (`fastanime anilist search`) +### Powerful Searching (`viu anilist search`) Filter the entire AniList database with powerful command-line flags. ```bash # Search for anime from 2024, sorted by popularity, that is releasing and not on your list -fastanime anilist search -y 2024 -s POPULARITY_DESC --status RELEASING --not-on-list +viu anilist search -y 2024 -s POPULARITY_DESC --status RELEASING --not-on-list # Find the most popular movies with the "Fantasy" genre -fastanime anilist search -g Fantasy -f MOVIE -s POPULARITY_DESC +viu anilist search -g Fantasy -f MOVIE -s POPULARITY_DESC # Dump search results as JSON instead of launching the TUI -fastanime anilist search -t "Demon Slayer" --dump-json +viu anilist search -t "Demon Slayer" --dump-json ``` -### Background Downloads (`fastanime queue` & `worker`) +### Background Downloads (`viu queue` & `worker`) -FastAnime includes a robust background downloading system. +Viu includes a robust background downloading system. 1. **Add episodes to the queue:** ```bash # Add episodes 1-12 of Jujutsu Kaisen to the download queue - fastanime queue add -t "Jujutsu Kaisen" -r "0:12" + viu queue add -t "Jujutsu Kaisen" -r "0:12" ``` 2. **Start the worker process:** ```bash # Run the worker in the foreground (press Ctrl+C to stop) - fastanime worker + viu worker # Or run it as a background process - fastanime worker & + viu worker & ```The worker will now process the queue, download your episodes, and check for notifications. ### Scriptable Commands (`download` & `search`) @@ -221,24 +221,24 @@ These commands are designed for automation and quick, non-interactive tasks. #### `download` Examples ```bash # Download the latest 5 episodes of One Piece -fastanime download -t "One Piece" -r "-5" +viu download -t "One Piece" -r "-5" # Download episodes 1 to 24, merge subtitles, and clean up original files -fastanime download -t "Jujutsu Kaisen" -r "0:24" --merge --clean +viu download -t "Jujutsu Kaisen" -r "0:24" --merge --clean ``` #### `search` (Binging) Examples ```bash # Start binging an anime from the first episode -fastanime search -t "Attack on Titan" -r ":" +viu search -t "Attack on Titan" -r ":" # Watch the latest episode directly -fastanime search -t "My Hero Academia" -r "-1" +viu search -t "My Hero Academia" -r "-1" ``` -### Local Data Management (`fastanime registry`) +### Local Data Management (`viu registry`) -FastAnime maintains a local database of your anime for offline access and enhanced performance. +Viu maintains a local database of your anime for offline access and enhanced performance. * `registry sync`: Synchronize your local data with your remote AniList account. * `registry stats`: Show detailed statistics about your viewing habits. @@ -249,13 +249,13 @@ FastAnime maintains a local database of your anime for offline access and enhanc ## Configuration -FastAnime is highly customizable. A default configuration file with detailed comments is created on the first run. +Viu is highly customizable. A default configuration file with detailed comments is created on the first run. -* **Find your config file:** `fastanime config --path` -* **Edit in your default editor:** `fastanime config` -* **Use the interactive wizard:** `fastanime config --interactive` +* **Find your config file:** `viu config --path` +* **Edit in your default editor:** `viu config` +* **Use the interactive wizard:** `viu config --interactive` -Most settings in the config file can be temporarily overridden with command-line flags (e.g., `fastanime --provider animepahe anilist`). +Most settings in the config file can be temporarily overridden with command-line flags (e.g., `viu --provider animepahe anilist`).
Default Configuration (`config.ini`) Explained @@ -303,7 +303,7 @@ download_check_interval = 5 ; How often to process the download queue (minu ### MPV IPC Integration -When `use_ipc = True` is set in your config, FastAnime provides powerful in-player controls without needing to close MPV. +When `use_ipc = True` is set in your config, Viu provides powerful in-player controls without needing to close MPV. **Key Bindings:** * `Shift+N`: Play the next episode. @@ -320,27 +320,27 @@ When `use_ipc = True` is set in your config, FastAnime provides powerful in-play You can run the background worker as a systemd service for persistence. -1. Create a service file at `~/.config/systemd/user/fastanime-worker.service`: +1. Create a service file at `~/.config/systemd/user/viu-worker.service`: ```ini [Unit] - Description=FastAnime Background Worker + Description=Viu Background Worker After=network-online.target [Service] Type=simple - ExecStart=/path/to/your/fastanime worker --log + ExecStart=/path/to/your/viu worker --log Restart=always RestartSec=30 [Install] WantedBy=default.target ``` - *Replace `/path/to/your/fastanime` with the output of `which fastanime`.* + *Replace `/path/to/your/viu` with the output of `which viu`.* 2. Enable and start the service: ```bash systemctl --user daemon-reload - systemctl --user enable --now fastanime-worker.service + systemctl --user enable --now viu-worker.service ``` ## Contributing diff --git a/bundle/Dockerfile b/bundle/Dockerfile index c4a0caa..21bbe29 100644 --- a/bundle/Dockerfile +++ b/bundle/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.12-slim-bookworm COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ -COPY . /fastanime +COPY . /viu ENV PATH=/root/.local/bin:$PATH -WORKDIR /fastanime +WORKDIR /viu RUN uv tool install . CMD ["bash"] diff --git a/bundle/pyinstaller.spec b/bundle/pyinstaller.spec index 2fe8a05..78a6547 100644 --- a/bundle/pyinstaller.spec +++ b/bundle/pyinstaller.spec @@ -5,7 +5,7 @@ block_cipher = None # Collect all required data files datas = [ - ('fastanime/assets/*', 'fastanime/assets'), + ('viu/assets/*', 'viu/assets'), ] # Collect all required hidden imports @@ -16,11 +16,11 @@ hiddenimports = [ 'yt_dlp', 'python_mpv', 'fuzzywuzzy', - 'fastanime', -] + collect_submodules('fastanime') + 'viu', +] + collect_submodules('viu') a = Analysis( - ['./fastanime/fastanime.py'], # Changed entry point + ['./viu/viu.py'], # Changed entry point pathex=[], binaries=[], datas=datas, @@ -49,7 +49,7 @@ exe = EXE( a.zipfiles, a.datas, [], - name='fastanime', + name='viu', debug=False, bootloader_ignore_signals=False, strip=True, @@ -61,5 +61,5 @@ exe = EXE( target_arch=None, codesign_identity=None, entitlements_file=None, - icon='fastanime/assets/logo.ico' + icon='viu/assets/logo.ico' ) diff --git a/completions/fastanime.bash b/completions/viu.bash similarity index 72% rename from completions/fastanime.bash rename to completions/viu.bash index 8e1929f..cbf4fa9 100644 --- a/completions/fastanime.bash +++ b/completions/viu.bash @@ -1,8 +1,8 @@ -_fastanime_completion() { +_viu_completion() { local IFS=$'\n' local response - response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD _FASTANIME_COMPLETE=bash_complete $1) + response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD _VIU_COMPLETE=bash_complete $1) for completion in $response; do IFS=',' read type value <<< "$completion" @@ -21,9 +21,9 @@ _fastanime_completion() { return 0 } -_fastanime_completion_setup() { - complete -o nosort -F _fastanime_completion fastanime +_viu_completion_setup() { + complete -o nosort -F _viu_completion viu } -_fastanime_completion_setup; +_viu_completion_setup; diff --git a/completions/fastanime.fish b/completions/viu.fish similarity index 61% rename from completions/fastanime.fish rename to completions/viu.fish index 6139239..25e8c31 100644 --- a/completions/fastanime.fish +++ b/completions/viu.fish @@ -1,5 +1,5 @@ -function _fastanime_completion; - set -l response (env _FASTANIME_COMPLETE=fish_complete COMP_WORDS=(commandline -cp) COMP_CWORD=(commandline -t) fastanime); +function _viu_completion; + set -l response (env _VIU_COMPLETE=fish_complete COMP_WORDS=(commandline -cp) COMP_CWORD=(commandline -t) viu); for completion in $response; set -l metadata (string split "," $completion); @@ -14,5 +14,5 @@ function _fastanime_completion; end; end; -complete --no-files --command fastanime --arguments "(_fastanime_completion)"; +complete --no-files --command viu --arguments "(_viu_completion)"; diff --git a/completions/fastanime.zsh b/completions/viu.zsh similarity index 80% rename from completions/fastanime.zsh rename to completions/viu.zsh index 5fdc101..9eb1b19 100644 --- a/completions/fastanime.zsh +++ b/completions/viu.zsh @@ -1,12 +1,12 @@ -#compdef fastanime +#compdef viu -_fastanime_completion() { +_viu_completion() { local -a completions local -a completions_with_descriptions local -a response - (( ! $+commands[fastanime] )) && return 1 + (( ! $+commands[viu] )) && return 1 - response=("${(@f)$(env COMP_WORDS="${words[*]}" COMP_CWORD=$((CURRENT-1)) _FASTANIME_COMPLETE=zsh_complete fastanime)}") + response=("${(@f)$(env COMP_WORDS="${words[*]}" COMP_CWORD=$((CURRENT-1)) _VIU_COMPLETE=zsh_complete viu)}") for type key descr in ${response}; do if [[ "$type" == "plain" ]]; then @@ -33,9 +33,9 @@ _fastanime_completion() { if [[ $zsh_eval_context[-1] == loadautofunc ]]; then # autoload from fpath, call function directly - _fastanime_completion "$@" + _viu_completion "$@" else # eval/source/. command, register function for later - compdef _fastanime_completion fastanime + compdef _viu_completion viu fi diff --git a/dev/generate_completions.sh b/dev/generate_completions.sh old mode 100755 new mode 100644 index bdcb94a..cc76b6d --- a/dev/generate_completions.sh +++ b/dev/generate_completions.sh @@ -5,10 +5,10 @@ APP_DIR="$( )" # fish shell completions -_FASTANIME_COMPLETE=fish_source fastanime >"$APP_DIR/completions/fastanime.fish" +_VIU_COMPLETE=fish_source viu >"$APP_DIR/completions/viu.fish" # zsh completions -_FASTANIME_COMPLETE=zsh_source fastanime >"$APP_DIR/completions/fastanime.zsh" +_VIU_COMPLETE=zsh_source viu >"$APP_DIR/completions/viu.zsh" # bash completions -_FASTANIME_COMPLETE=bash_source fastanime >"$APP_DIR/completions/fastanime.bash" +_VIU_COMPLETE=bash_source viu >"$APP_DIR/completions/viu.bash" diff --git a/dev/make_release b/dev/make_release old mode 100755 new mode 100644 index 05de1c2..20c1caf --- a/dev/make_release +++ b/dev/make_release @@ -2,11 +2,11 @@ CLI_DIR="$(dirname "$(realpath "$0")")" VERSION=$1 [ -z "$VERSION" ] && echo no version provided && exit 1 -[ "$VERSION" = "current" ] && fastanime --version && exit 0 +[ "$VERSION" = "current" ] && viu --version && exit 0 sed -i "s/^version.*/version = \"$VERSION\"/" "$CLI_DIR/pyproject.toml" && - sed -i "s/__version__.*/__version__ = \"v$VERSION\"/" "$CLI_DIR/fastanime/__init__.py" && + sed -i "s/__version__.*/__version__ = \"v$VERSION\"/" "$CLI_DIR/viu/__init__.py" && sed -i "s/version = .*/version = \"$VERSION\";/" "$CLI_DIR/flake.nix" && - git stage "$CLI_DIR/pyproject.toml" "$CLI_DIR/fastanime/__init__.py" "$CLI_DIR/flake.nix" && + git stage "$CLI_DIR/pyproject.toml" "$CLI_DIR/viu/__init__.py" "$CLI_DIR/flake.nix" && git commit -m "chore: bump version (v$VERSION)" && # nix flake lock && uv lock && diff --git a/fa b/fa old mode 100755 new mode 100644 index aa076fb..9676aad --- a/fa +++ b/fa @@ -3,4 +3,4 @@ provider_type=$1 provider_name=$2 [ -z "$provider_type" ] && echo "Please specify provider type" && exit [ -z "$provider_name" ] && echo "Please specify provider type" && exit -uv run python -m fastanime.libs.provider.${provider_type}.${provider_name}.provider +uv run python -m viu.libs.provider.${provider_type}.${provider_name}.provider diff --git a/fastanime/assets/defaults/ascii-art b/fastanime/assets/defaults/ascii-art deleted file mode 100644 index d9c53d9..0000000 --- a/fastanime/assets/defaults/ascii-art +++ /dev/null @@ -1,6 +0,0 @@ -███████╗░█████╗░░██████╗████████╗░█████╗░███╗░░██╗██╗███╗░░░███╗███████╗ -██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗████╗░██║██║████╗░████║██╔════╝ -█████╗░░███████║╚█████╗░░░░██║░░░███████║██╔██╗██║██║██╔████╔██║█████╗░░ -██╔══╝░░██╔══██║░╚═══██╗░░░██║░░░██╔══██║██║╚████║██║██║╚██╔╝██║██╔══╝░░ -██║░░░░░██║░░██║██████╔╝░░░██║░░░██║░░██║██║░╚███║██║██║░╚═╝░██║███████╗ -╚═╝░░░░░╚═╝░░╚═╝╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░░░░╚═╝╚══════╝ diff --git a/fastanime/cli/commands/anilist/examples.py b/fastanime/cli/commands/anilist/examples.py deleted file mode 100644 index 14b43c9..0000000 --- a/fastanime/cli/commands/anilist/examples.py +++ /dev/null @@ -1,169 +0,0 @@ -download = """ -\b -\b\bExamples: - # Basic download by title - fastanime anilist download -t "Attack on Titan" -\b - # Download specific episodes - fastanime anilist download -t "One Piece" --episode-range "1-10" -\b - # Download single episode - fastanime anilist download -t "Death Note" --episode-range "1" -\b - # Download multiple specific episodes - fastanime anilist download -t "Naruto" --episode-range "1,5,10" -\b - # Download with quality preference - fastanime anilist download -t "Death Note" --quality 1080 --episode-range "1-5" -\b - # Download with multiple filters - fastanime anilist download -g Action -T Isekai --score-greater 80 --status RELEASING -\b - # Download with concurrent downloads - fastanime anilist download -t "Demon Slayer" --episode-range "1-5" --max-concurrent 3 -\b - # Force redownload existing episodes - fastanime anilist download -t "Your Name" --episode-range "1" --force-redownload -\b - # Download from a specific season and year - fastanime anilist download --season WINTER --year 2024 -s POPULARITY_DESC -\b - # Download with genre filtering - fastanime anilist download -g Action -g Adventure --score-greater 75 -\b - # Download only completed series - fastanime anilist download -g Fantasy --status FINISHED --score-greater 75 -\b - # Download movies only - fastanime anilist download -F MOVIE -s SCORE_DESC --quality best -""" - - -search = """ -\b -\b\bExamples: - # Basic search by title - fastanime anilist search -t "Attack on Titan" -\b - # Search with multiple filters - fastanime anilist search -g Action -T Isekai --score-greater 75 --status RELEASING -\b - # Get anime with the tag of isekai - fastanime anilist search -T isekai -\b - # Get anime of 2024 and sort by popularity, finished or releasing, not in your list - fastanime anilist search -y 2024 -s POPULARITY_DESC --status RELEASING --status FINISHED --not-on-list -\b - # Get anime of 2024 season WINTER - fastanime anilist search -y 2024 --season WINTER -\b - # Get anime genre action and tag isekai,magic - fastanime anilist search -g Action -T Isekai -T Magic -\b - # Get anime of 2024 thats finished airing - fastanime anilist search -y 2024 -S FINISHED -\b - # Get the most favourite anime movies - fastanime anilist search -f MOVIE -s FAVOURITES_DESC -\b - # Search with score and popularity filters - fastanime anilist search --score-greater 80 --popularity-greater 50000 -\b - # Search excluding certain genres and tags - fastanime anilist search --genres-not Ecchi --tags-not "Hentai" -\b - # Search with date ranges (YYYYMMDD format) - fastanime anilist search --start-date-greater 20200101 --start-date-lesser 20241231 -\b - # Get only TV series, exclude certain statuses - fastanime anilist search -f TV --status-not CANCELLED --status-not HIATUS -\b - # Paginated search with custom page size - fastanime anilist search -g Action --page 2 --per-page 25 -\b - # Search for manga specifically - fastanime anilist search --media-type MANGA -g Fantasy -\b - # Complex search with multiple criteria - fastanime anilist search -t "demon" -g Action -g Supernatural --score-greater 70 --year 2020 -s SCORE_DESC -\b - # Dump search results as JSON instead of interactive mode - fastanime anilist search -g Action --dump-json -""" - - -main = """ -\b -\b\bExamples: - # ---- search ---- -\b - # Basic search by title - fastanime anilist search -t "Attack on Titan" -\b - # Search with multiple filters - fastanime anilist search -g Action -T Isekai --score-greater 75 --status RELEASING -\b - # Get anime with the tag of isekai - fastanime anilist search -T isekai -\b - # Get anime of 2024 and sort by popularity, finished or releasing, not in your list - fastanime anilist search -y 2024 -s POPULARITY_DESC --status RELEASING --status FINISHED --not-on-list -\b - # Get anime of 2024 season WINTER - fastanime anilist search -y 2024 --season WINTER -\b - # Get anime genre action and tag isekai,magic - fastanime anilist search -g Action -T Isekai -T Magic -\b - # Get anime of 2024 thats finished airing - fastanime anilist search -y 2024 -S FINISHED -\b - # Get the most favourite anime movies - fastanime anilist search -f MOVIE -s FAVOURITES_DESC -\b - # Search with score and popularity filters - fastanime anilist search --score-greater 80 --popularity-greater 50000 -\b - # Search excluding certain genres and tags - fastanime anilist search --genres-not Ecchi --tags-not "Hentai" -\b - # Search with date ranges (YYYYMMDD format) - fastanime anilist search --start-date-greater 20200101 --start-date-lesser 20241231 -\b - # Get only TV series, exclude certain statuses - fastanime anilist search -f TV --status-not CANCELLED --status-not HIATUS -\b - # Paginated search with custom page size - fastanime anilist search -g Action --page 2 --per-page 25 -\b - # Search for manga specifically - fastanime anilist search --media-type MANGA -g Fantasy -\b - # Complex search with multiple criteria - fastanime anilist search -t "demon" -g Action -g Supernatural --score-greater 70 --year 2020 -s SCORE_DESC -\b - # Dump search results as JSON instead of interactive mode - fastanime anilist search -g Action --dump-json -\b - # ---- login ---- -\b - # To sign in just run - fastanime anilist auth -\b - # To check your login status - fastanime anilist auth --status -\b - # To log out and erase credentials - fastanime anilist auth --logout -\b - # ---- notifier ---- -\b - # basic form - fastanime anilist notifier -\b - # with logging to stdout - fastanime --log anilist notifier -\b - # with logging to a file. stored in the same place as your config - fastanime --log-file anilist notifier -""" diff --git a/fastanime/cli/commands/registry/examples.py b/fastanime/cli/commands/registry/examples.py deleted file mode 100644 index 4d17aa3..0000000 --- a/fastanime/cli/commands/registry/examples.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -Example usage for the registry command -""" - -main = """ - -Examples: - # Sync with remote AniList - fastanime registry sync --upload --download - - # Show detailed registry statistics - fastanime registry stats --detailed - - # Search local registry - fastanime registry search "attack on titan" - - # Export registry to JSON - fastanime registry export --format json --output backup.json - - # Import from backup - fastanime registry import backup.json - - # Clean up orphaned entries - fastanime registry clean --dry-run - - # Create full backup - fastanime registry backup --compress - - # Restore from backup - fastanime registry restore backup.tar.gz -""" diff --git a/fastanime/core/utils/__init__.py b/fastanime/core/utils/__init__.py deleted file mode 100644 index 487ede2..0000000 --- a/fastanime/core/utils/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" -Core utilities for FastAnime application. - -This module provides various utility classes and functions used throughout -the FastAnime application, including concurrency management, file operations, -and other common functionality. -""" diff --git a/flake.nix b/flake.nix index fb8d17e..e851d9d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "FastAnime Project Flake"; + description = "Viu Project Flake"; inputs = { # The nixpkgs unstable latest commit breaks the plyer python package @@ -23,7 +23,7 @@ in { packages.default = python3Packages.buildPythonApplication { - pname = "fastanime"; + pname = "viu"; inherit version; pyproject = true; @@ -67,13 +67,13 @@ # Needs to be adapted for the nix derivation build doCheck = false; - pythonImportsCheck = [ "fastanime" ]; + pythonImportsCheck = [ "viu" ]; meta = { description = "Your browser anime experience from the terminal"; - homepage = "https://github.com/Benexl/FastAnime"; - changelog = "https://github.com/Benexl/FastAnime/releases/tag/v${version}"; - mainProgram = "fastanime"; + homepage = "https://github.com/Benexl/Viu"; + changelog = "https://github.com/Benexl/Viu/releases/tag/v${version}"; + mainProgram = "viu"; license = lib.licenses.unlicense; maintainers = with lib.maintainers; [ theobori ]; }; diff --git a/pyproject.toml b/pyproject.toml index bcf6ca6..1db6b6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "fastanime" +name = "viu" version = "3.1.0" description = "A browser anime site experience from the terminal" license = "UNLICENSE" @@ -14,7 +14,7 @@ dependencies = [ ] [project.scripts] -fastanime = 'fastanime:Cli' +viu = 'viu:Cli' [project.optional-dependencies] standard = [ diff --git a/uv.lock b/uv.lock index f764718..d368572 100644 --- a/uv.lock +++ b/uv.lock @@ -102,7 +102,7 @@ wheels = [ ] [[package]] -name = "fastanime" +name = "viu" version = "3.1.0" source = { editable = "." } dependencies = [ diff --git a/fastanime/__init__.py b/viu/__init__.py similarity index 78% rename from fastanime/__init__.py rename to viu/__init__.py index 0da8781..76d683b 100644 --- a/fastanime/__init__.py +++ b/viu/__init__.py @@ -2,7 +2,7 @@ import sys if sys.version_info < (3, 10): raise ImportError( - "You are using an unsupported version of Python. Only Python versions 3.10 and above are supported by FastAnime" + "You are using an unsupported version of Python. Only Python versions 3.10 and above are supported by Viu" ) # noqa: F541 diff --git a/fastanime/__main__.py b/viu/__main__.py similarity index 100% rename from fastanime/__main__.py rename to viu/__main__.py diff --git a/viu/assets/defaults/ascii-art b/viu/assets/defaults/ascii-art new file mode 100644 index 0000000..575824c --- /dev/null +++ b/viu/assets/defaults/ascii-art @@ -0,0 +1,7 @@ + +██╗░░░██╗██╗██╗░░░██╗ +██║░░░██║██║██║░░░██║ +╚██╗░██╔╝██║██║░░░██║ +░╚████╔╝░██║██║░░░██║ +░░╚██╔╝░░██║╚██████╔╝ +░░░╚═╝░░░╚═╝░╚═════╝░ diff --git a/fastanime/assets/defaults/fzf-opts b/viu/assets/defaults/fzf-opts similarity index 100% rename from fastanime/assets/defaults/fzf-opts rename to viu/assets/defaults/fzf-opts diff --git a/fastanime/assets/defaults/rofi-themes/confirm.rasi b/viu/assets/defaults/rofi-themes/confirm.rasi similarity index 98% rename from fastanime/assets/defaults/rofi-themes/confirm.rasi rename to viu/assets/defaults/rofi-themes/confirm.rasi index 7fb718e..061b8c9 100644 --- a/fastanime/assets/defaults/rofi-themes/confirm.rasi +++ b/viu/assets/defaults/rofi-themes/confirm.rasi @@ -1,5 +1,5 @@ /** - * Rofi Theme: FastAnime "Tokyo Night" Confirmation + * Rofi Theme: Viu "Tokyo Night" Confirmation * Author: Gemini ft Benexl * Description: A compact and clear modal dialog for Yes/No confirmations that displays a prompt. */ diff --git a/fastanime/assets/defaults/rofi-themes/input.rasi b/viu/assets/defaults/rofi-themes/input.rasi similarity index 97% rename from fastanime/assets/defaults/rofi-themes/input.rasi rename to viu/assets/defaults/rofi-themes/input.rasi index 60917be..649bfbd 100644 --- a/fastanime/assets/defaults/rofi-themes/input.rasi +++ b/viu/assets/defaults/rofi-themes/input.rasi @@ -1,5 +1,5 @@ /** - * Rofi Theme: FastAnime "Tokyo Night" Input + * Rofi Theme: Viu "Tokyo Night" Input * Author: Gemini ft Benexl * Description: A compact, modern modal dialog for text input that correctly displays the prompt. */ diff --git a/fastanime/assets/defaults/rofi-themes/main.rasi b/viu/assets/defaults/rofi-themes/main.rasi similarity index 98% rename from fastanime/assets/defaults/rofi-themes/main.rasi rename to viu/assets/defaults/rofi-themes/main.rasi index 07c3470..6640fd2 100644 --- a/fastanime/assets/defaults/rofi-themes/main.rasi +++ b/viu/assets/defaults/rofi-themes/main.rasi @@ -1,5 +1,5 @@ /** - * Rofi Theme: FastAnime "Tokyo Night" Main + * Rofi Theme: Viu "Tokyo Night" Main * Author: Gemini ft Benexl * Description: A sharp, modern, and ultra-compact theme with a Tokyo Night palette. */ diff --git a/fastanime/assets/defaults/rofi-themes/preview.rasi b/viu/assets/defaults/rofi-themes/preview.rasi similarity index 97% rename from fastanime/assets/defaults/rofi-themes/preview.rasi rename to viu/assets/defaults/rofi-themes/preview.rasi index feac9cf..ef4f0e3 100644 --- a/fastanime/assets/defaults/rofi-themes/preview.rasi +++ b/viu/assets/defaults/rofi-themes/preview.rasi @@ -1,5 +1,5 @@ /** - * Rofi Theme: FastAnime "Tokyo Night" Horizontal Strip + * Rofi Theme: Viu "Tokyo Night" Horizontal Strip * Author: Gemini ft Benexl * Description: A fullscreen, horizontal, icon-centric theme for previews. */ diff --git a/fastanime/assets/defaults/fastanime-worker.template.service b/viu/assets/defaults/viu-worker.template.service similarity index 62% rename from fastanime/assets/defaults/fastanime-worker.template.service rename to viu/assets/defaults/viu-worker.template.service index 2074c1c..bfd4bea 100644 --- a/fastanime/assets/defaults/fastanime-worker.template.service +++ b/viu/assets/defaults/viu-worker.template.service @@ -1,13 +1,13 @@ # values in {NAME} syntax are provided by python using .replace() # [Unit] -Description=FastAnime Background Worker +Description=Viu Background Worker After=network-online.target [Service] Type=simple -# Ensure you have the full path to your fastanime executable -# Use `which fastanime` to find it +# Ensure you have the full path to your viu executable +# Use `which viu` to find it ExecStart={EXECUTABLE} worker --log Restart=always RestartSec=30 diff --git a/fastanime/assets/graphql/allanime/queries/anime.gql b/viu/assets/graphql/allanime/queries/anime.gql similarity index 100% rename from fastanime/assets/graphql/allanime/queries/anime.gql rename to viu/assets/graphql/allanime/queries/anime.gql diff --git a/fastanime/assets/graphql/allanime/queries/episodes.gql b/viu/assets/graphql/allanime/queries/episodes.gql similarity index 100% rename from fastanime/assets/graphql/allanime/queries/episodes.gql rename to viu/assets/graphql/allanime/queries/episodes.gql diff --git a/fastanime/assets/graphql/allanime/queries/search.gql b/viu/assets/graphql/allanime/queries/search.gql similarity index 100% rename from fastanime/assets/graphql/allanime/queries/search.gql rename to viu/assets/graphql/allanime/queries/search.gql diff --git a/fastanime/assets/graphql/anilist/mutations/delete-list-entry.gql b/viu/assets/graphql/anilist/mutations/delete-list-entry.gql similarity index 100% rename from fastanime/assets/graphql/anilist/mutations/delete-list-entry.gql rename to viu/assets/graphql/anilist/mutations/delete-list-entry.gql diff --git a/fastanime/assets/graphql/anilist/mutations/mark-read.gql b/viu/assets/graphql/anilist/mutations/mark-read.gql similarity index 100% rename from fastanime/assets/graphql/anilist/mutations/mark-read.gql rename to viu/assets/graphql/anilist/mutations/mark-read.gql diff --git a/fastanime/assets/graphql/anilist/mutations/media-list.gql b/viu/assets/graphql/anilist/mutations/media-list.gql similarity index 100% rename from fastanime/assets/graphql/anilist/mutations/media-list.gql rename to viu/assets/graphql/anilist/mutations/media-list.gql diff --git a/fastanime/assets/graphql/anilist/queries/logged-in-user.gql b/viu/assets/graphql/anilist/queries/logged-in-user.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/logged-in-user.gql rename to viu/assets/graphql/anilist/queries/logged-in-user.gql diff --git a/fastanime/assets/graphql/anilist/queries/media-airing-schedule.gql b/viu/assets/graphql/anilist/queries/media-airing-schedule.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/media-airing-schedule.gql rename to viu/assets/graphql/anilist/queries/media-airing-schedule.gql diff --git a/fastanime/assets/graphql/anilist/queries/media-characters.gql b/viu/assets/graphql/anilist/queries/media-characters.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/media-characters.gql rename to viu/assets/graphql/anilist/queries/media-characters.gql diff --git a/fastanime/assets/graphql/anilist/queries/media-list-item.gql b/viu/assets/graphql/anilist/queries/media-list-item.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/media-list-item.gql rename to viu/assets/graphql/anilist/queries/media-list-item.gql diff --git a/fastanime/assets/graphql/anilist/queries/media-list.gql b/viu/assets/graphql/anilist/queries/media-list.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/media-list.gql rename to viu/assets/graphql/anilist/queries/media-list.gql diff --git a/fastanime/assets/graphql/anilist/queries/media-recommendations.gql b/viu/assets/graphql/anilist/queries/media-recommendations.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/media-recommendations.gql rename to viu/assets/graphql/anilist/queries/media-recommendations.gql diff --git a/fastanime/assets/graphql/anilist/queries/media-relations.gql b/viu/assets/graphql/anilist/queries/media-relations.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/media-relations.gql rename to viu/assets/graphql/anilist/queries/media-relations.gql diff --git a/fastanime/assets/graphql/anilist/queries/notifications.gql b/viu/assets/graphql/anilist/queries/notifications.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/notifications.gql rename to viu/assets/graphql/anilist/queries/notifications.gql diff --git a/fastanime/assets/graphql/anilist/queries/reviews.gql b/viu/assets/graphql/anilist/queries/reviews.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/reviews.gql rename to viu/assets/graphql/anilist/queries/reviews.gql diff --git a/fastanime/assets/graphql/anilist/queries/search.gql b/viu/assets/graphql/anilist/queries/search.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/search.gql rename to viu/assets/graphql/anilist/queries/search.gql diff --git a/fastanime/assets/graphql/anilist/queries/user-info.gql b/viu/assets/graphql/anilist/queries/user-info.gql similarity index 100% rename from fastanime/assets/graphql/anilist/queries/user-info.gql rename to viu/assets/graphql/anilist/queries/user-info.gql diff --git a/fastanime/assets/icons/logo.ico b/viu/assets/icons/logo.ico similarity index 100% rename from fastanime/assets/icons/logo.ico rename to viu/assets/icons/logo.ico diff --git a/fastanime/assets/icons/logo.png b/viu/assets/icons/logo.png similarity index 100% rename from fastanime/assets/icons/logo.png rename to viu/assets/icons/logo.png diff --git a/fastanime/assets/normalizer.json b/viu/assets/normalizer.json similarity index 100% rename from fastanime/assets/normalizer.json rename to viu/assets/normalizer.json diff --git a/fastanime/assets/scripts/fzf/airing-schedule-info.template.sh b/viu/assets/scripts/fzf/airing-schedule-info.template.sh similarity index 89% rename from fastanime/assets/scripts/fzf/airing-schedule-info.template.sh rename to viu/assets/scripts/fzf/airing-schedule-info.template.sh index e2fe059..59d5e56 100644 --- a/fastanime/assets/scripts/fzf/airing-schedule-info.template.sh +++ b/viu/assets/scripts/fzf/airing-schedule-info.template.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# FastAnime Airing Schedule Info Script Template +# Viu Airing Schedule Info Script Template # This script formats and displays airing schedule details in the FZF preview pane. # Python injects the actual data values into the placeholders. diff --git a/fastanime/assets/scripts/fzf/airing-schedule-preview.template.sh b/viu/assets/scripts/fzf/airing-schedule-preview.template.sh similarity index 100% rename from fastanime/assets/scripts/fzf/airing-schedule-preview.template.sh rename to viu/assets/scripts/fzf/airing-schedule-preview.template.sh diff --git a/fastanime/assets/scripts/fzf/character-info.template.sh b/viu/assets/scripts/fzf/character-info.template.sh similarity index 96% rename from fastanime/assets/scripts/fzf/character-info.template.sh rename to viu/assets/scripts/fzf/character-info.template.sh index 4cd532c..610b422 100644 --- a/fastanime/assets/scripts/fzf/character-info.template.sh +++ b/viu/assets/scripts/fzf/character-info.template.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# FastAnime Character Info Script Template +# Viu Character Info Script Template # This script formats and displays character details in the FZF preview pane. # Python injects the actual data values into the placeholders. diff --git a/fastanime/assets/scripts/fzf/character-preview.template.sh b/viu/assets/scripts/fzf/character-preview.template.sh similarity index 100% rename from fastanime/assets/scripts/fzf/character-preview.template.sh rename to viu/assets/scripts/fzf/character-preview.template.sh diff --git a/fastanime/assets/scripts/fzf/dynamic-preview.template.sh b/viu/assets/scripts/fzf/dynamic-preview.template.sh similarity index 100% rename from fastanime/assets/scripts/fzf/dynamic-preview.template.sh rename to viu/assets/scripts/fzf/dynamic-preview.template.sh diff --git a/fastanime/assets/scripts/fzf/episode-info.template.sh b/viu/assets/scripts/fzf/episode-info.template.sh similarity index 100% rename from fastanime/assets/scripts/fzf/episode-info.template.sh rename to viu/assets/scripts/fzf/episode-info.template.sh diff --git a/fastanime/assets/scripts/fzf/info.template.sh b/viu/assets/scripts/fzf/info.template.sh old mode 100755 new mode 100644 similarity index 96% rename from fastanime/assets/scripts/fzf/info.template.sh rename to viu/assets/scripts/fzf/info.template.sh index 7734575..ad96b77 --- a/fastanime/assets/scripts/fzf/info.template.sh +++ b/viu/assets/scripts/fzf/info.template.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# FastAnime Preview Info Script Template +# Viu Preview Info Script Template # This script formats and displays the textual information in the FZF preview pane. # Some values are injected by python those with '{name}' syntax using .replace() diff --git a/fastanime/assets/scripts/fzf/preview.template.sh b/viu/assets/scripts/fzf/preview.template.sh similarity index 100% rename from fastanime/assets/scripts/fzf/preview.template.sh rename to viu/assets/scripts/fzf/preview.template.sh diff --git a/fastanime/assets/scripts/fzf/review-info.template.sh b/viu/assets/scripts/fzf/review-info.template.sh similarity index 88% rename from fastanime/assets/scripts/fzf/review-info.template.sh rename to viu/assets/scripts/fzf/review-info.template.sh index 67c0e3d..fb7cbbc 100644 --- a/fastanime/assets/scripts/fzf/review-info.template.sh +++ b/viu/assets/scripts/fzf/review-info.template.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# FastAnime Review Info Script Template +# Viu Review Info Script Template # This script formats and displays review details in the FZF preview pane. # Python injects the actual data values into the placeholders. diff --git a/fastanime/assets/scripts/fzf/review-preview.template.sh b/viu/assets/scripts/fzf/review-preview.template.sh similarity index 100% rename from fastanime/assets/scripts/fzf/review-preview.template.sh rename to viu/assets/scripts/fzf/review-preview.template.sh diff --git a/fastanime/assets/scripts/fzf/search.template.sh b/viu/assets/scripts/fzf/search.template.sh similarity index 100% rename from fastanime/assets/scripts/fzf/search.template.sh rename to viu/assets/scripts/fzf/search.template.sh diff --git a/fastanime/cli/__init__.py b/viu/cli/__init__.py similarity index 100% rename from fastanime/cli/__init__.py rename to viu/cli/__init__.py diff --git a/fastanime/cli/cli.py b/viu/cli/cli.py similarity index 97% rename from fastanime/cli/cli.py rename to viu/cli/cli.py index c8bbfac..96aa3c6 100644 --- a/fastanime/cli/cli.py +++ b/viu/cli/cli.py @@ -43,7 +43,7 @@ commands = { @click.group( cls=LazyGroup, - root="fastanime.cli.commands", + root="viu.cli.commands", lazy_subcommands=commands, context_settings=dict(auto_envvar_prefix=PROJECT_NAME), ) @@ -68,7 +68,7 @@ commands = { @click.pass_context def cli(ctx: click.Context, **options: "Unpack[Options]"): """ - The main entry point for the FastAnime CLI. + The main entry point for the Viu CLI. """ setup_logging(options["log"]) setup_exceptions_handler( diff --git a/fastanime/cli/commands/__init__.py b/viu/cli/commands/__init__.py similarity index 100% rename from fastanime/cli/commands/__init__.py rename to viu/cli/commands/__init__.py diff --git a/fastanime/cli/commands/anilist/__init__.py b/viu/cli/commands/anilist/__init__.py similarity index 100% rename from fastanime/cli/commands/anilist/__init__.py rename to viu/cli/commands/anilist/__init__.py diff --git a/fastanime/cli/commands/anilist/cmd.py b/viu/cli/commands/anilist/cmd.py similarity index 95% rename from fastanime/cli/commands/anilist/cmd.py rename to viu/cli/commands/anilist/cmd.py index b0c4efa..8d190d1 100644 --- a/fastanime/cli/commands/anilist/cmd.py +++ b/viu/cli/commands/anilist/cmd.py @@ -18,7 +18,7 @@ commands = { @click.group( cls=LazyGroup, name="anilist", - root="fastanime.cli.commands.anilist.commands", + root="viu.cli.commands.anilist.commands", invoke_without_command=True, help="A beautiful interface that gives you access to a commplete streaming experience", short_help="Access all streaming options", diff --git a/fastanime/cli/commands/anilist/commands/__init__.py b/viu/cli/commands/anilist/commands/__init__.py similarity index 100% rename from fastanime/cli/commands/anilist/commands/__init__.py rename to viu/cli/commands/anilist/commands/__init__.py diff --git a/fastanime/cli/commands/anilist/commands/auth.py b/viu/cli/commands/anilist/commands/auth.py similarity index 100% rename from fastanime/cli/commands/anilist/commands/auth.py rename to viu/cli/commands/anilist/commands/auth.py diff --git a/fastanime/cli/commands/anilist/commands/download.py b/viu/cli/commands/anilist/commands/download.py similarity index 90% rename from fastanime/cli/commands/anilist/commands/download.py rename to viu/cli/commands/anilist/commands/download.py index bfd22b6..1265372 100644 --- a/fastanime/cli/commands/anilist/commands/download.py +++ b/viu/cli/commands/anilist/commands/download.py @@ -1,10 +1,10 @@ from typing import TYPE_CHECKING, Dict, List import click -from fastanime.cli.utils.completion import anime_titles_shell_complete -from fastanime.core.config import AppConfig -from fastanime.core.exceptions import FastAnimeError -from fastanime.libs.media_api.types import ( +from viu.cli.utils.completion import anime_titles_shell_complete +from viu.core.config import AppConfig +from viu.core.exceptions import ViuError +from viu.libs.media_api.types import ( MediaFormat, MediaGenre, MediaItem, @@ -112,15 +112,15 @@ if TYPE_CHECKING: ) @click.pass_obj def download(config: AppConfig, **options: "Unpack[DownloadOptions]"): - from fastanime.cli.service.download.service import DownloadService - from fastanime.cli.service.feedback import FeedbackService - from fastanime.cli.service.registry import MediaRegistryService - from fastanime.cli.service.watch_history import WatchHistoryService - from fastanime.cli.utils.parser import parse_episode_range - from fastanime.libs.media_api.api import create_api_client - from fastanime.libs.media_api.params import MediaSearchParams - from fastanime.libs.provider.anime.provider import create_provider - from fastanime.libs.selectors import create_selector + from viu.cli.service.download.service import DownloadService + from viu.cli.service.feedback import FeedbackService + from viu.cli.service.registry import MediaRegistryService + from viu.cli.service.watch_history import WatchHistoryService + from viu.cli.utils.parser import parse_episode_range + from viu.libs.media_api.api import create_api_client + from viu.libs.media_api.params import MediaSearchParams + from viu.libs.provider.anime.provider import create_provider + from viu.libs.selectors import create_selector from rich.progress import Progress feedback = FeedbackService(config) @@ -181,7 +181,7 @@ def download(config: AppConfig, **options: "Unpack[DownloadOptions]"): search_result = media_api.search_media(search_params) if not search_result or not search_result.media: - raise FastAnimeError("No anime found matching your search criteria.") + raise ViuError("No anime found matching your search criteria.") anime_to_download: List[MediaItem] if options.get("yes"): @@ -219,7 +219,7 @@ def download(config: AppConfig, **options: "Unpack[DownloadOptions]"): total_downloaded = 0 episode_range_str = options.get("episode_range") if not episode_range_str: - raise FastAnimeError("--episode-range is required.") + raise ViuError("--episode-range is required.") for media_item in anime_to_download: watch_history.add_media_to_list_if_not_present(media_item) @@ -259,7 +259,7 @@ def download(config: AppConfig, **options: "Unpack[DownloadOptions]"): f"Finished. Successfully downloaded a total of {total_downloaded} episodes." ) - except FastAnimeError as e: + except ViuError as e: feedback.error("Download command failed", str(e)) except Exception as e: feedback.error("An unexpected error occurred", str(e)) diff --git a/fastanime/cli/commands/anilist/commands/downloads.py b/viu/cli/commands/anilist/commands/downloads.py similarity index 100% rename from fastanime/cli/commands/anilist/commands/downloads.py rename to viu/cli/commands/anilist/commands/downloads.py diff --git a/fastanime/cli/commands/anilist/commands/notifications.py b/viu/cli/commands/anilist/commands/notifications.py similarity index 86% rename from fastanime/cli/commands/anilist/commands/notifications.py rename to viu/cli/commands/anilist/commands/notifications.py index dbaf240..07bd533 100644 --- a/fastanime/cli/commands/anilist/commands/notifications.py +++ b/viu/cli/commands/anilist/commands/notifications.py @@ -1,5 +1,5 @@ import click -from fastanime.core.config import AppConfig +from viu.core.config import AppConfig from rich.console import Console from rich.table import Table @@ -11,8 +11,8 @@ def notifications(config: AppConfig): Displays unread notifications from AniList. Running this command will also mark the notifications as read on the AniList website. """ - from fastanime.cli.service.feedback import FeedbackService - from fastanime.libs.media_api.api import create_api_client + from viu.cli.service.feedback import FeedbackService + from viu.libs.media_api.api import create_api_client from ....service.auth import AuthService @@ -25,7 +25,7 @@ def notifications(config: AppConfig): if not api_client.is_authenticated(): feedback.error( - "Authentication Required", "Please log in with 'fastanime anilist auth'." + "Authentication Required", "Please log in with 'viu anilist auth'." ) return diff --git a/fastanime/cli/commands/anilist/commands/search.py b/viu/cli/commands/anilist/commands/search.py similarity index 96% rename from fastanime/cli/commands/anilist/commands/search.py rename to viu/cli/commands/anilist/commands/search.py index 9387722..9f5d5a2 100644 --- a/fastanime/cli/commands/anilist/commands/search.py +++ b/viu/cli/commands/anilist/commands/search.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING import click from .....core.config import AppConfig -from .....core.exceptions import FastAnimeError +from .....core.exceptions import ViuError from .....libs.media_api.types import ( MediaFormat, MediaGenre, @@ -235,14 +235,14 @@ def search(config: AppConfig, **options: "Unpack[SearchOptions]"): and score_lesser is not None and score_greater > score_lesser ): - raise FastAnimeError("Minimum score cannot be higher than maximum score") + raise ViuError("Minimum score cannot be higher than maximum score") if ( popularity_greater is not None and popularity_lesser is not None and popularity_greater > popularity_lesser ): - raise FastAnimeError( + raise ViuError( "Minimum popularity cannot be higher than maximum popularity" ) @@ -251,7 +251,7 @@ def search(config: AppConfig, **options: "Unpack[SearchOptions]"): and start_date_lesser is not None and start_date_greater > start_date_lesser ): - raise FastAnimeError( + raise ViuError( "Start date greater cannot be later than start date lesser" ) @@ -260,7 +260,7 @@ def search(config: AppConfig, **options: "Unpack[SearchOptions]"): and end_date_lesser is not None and end_date_greater > end_date_lesser ): - raise FastAnimeError( + raise ViuError( "End date greater cannot be later than end date lesser" ) @@ -297,7 +297,7 @@ def search(config: AppConfig, **options: "Unpack[SearchOptions]"): search_result = api_client.search_media(search_params) if not search_result or not search_result.media: - raise FastAnimeError("No anime found matching your search criteria") + raise ViuError("No anime found matching your search criteria") if dump_json: # Use Pydantic's built-in serialization @@ -326,7 +326,7 @@ def search(config: AppConfig, **options: "Unpack[SearchOptions]"): session.load_menus_from_folder("media") session.run(config, history=[initial_state]) - except FastAnimeError as e: + except ViuError as e: feedback.error("Search failed", str(e)) raise click.Abort() except Exception as e: diff --git a/fastanime/cli/commands/anilist/commands/stats.py b/viu/cli/commands/anilist/commands/stats.py similarity index 96% rename from fastanime/cli/commands/anilist/commands/stats.py rename to viu/cli/commands/anilist/commands/stats.py index 4ddef7d..0ba07f3 100644 --- a/fastanime/cli/commands/anilist/commands/stats.py +++ b/viu/cli/commands/anilist/commands/stats.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING import click if TYPE_CHECKING: - from fastanime.core.config import AppConfig + from viu.core.config import AppConfig @click.command(help="Print out your anilist stats") @@ -38,7 +38,7 @@ def stats(config: "AppConfig"): ) feedback.info( "Run this command to authenticate:", - f"fastanime {config.general.media_api} auth", + f"viu {config.general.media_api} auth", ) raise click.Abort() diff --git a/viu/cli/commands/anilist/examples.py b/viu/cli/commands/anilist/examples.py new file mode 100644 index 0000000..321946e --- /dev/null +++ b/viu/cli/commands/anilist/examples.py @@ -0,0 +1,169 @@ +download = """ +\b +\b\bExamples: + # Basic download by title + viu anilist download -t "Attack on Titan" +\b + # Download specific episodes + viu anilist download -t "One Piece" --episode-range "1-10" +\b + # Download single episode + viu anilist download -t "Death Note" --episode-range "1" +\b + # Download multiple specific episodes + viu anilist download -t "Naruto" --episode-range "1,5,10" +\b + # Download with quality preference + viu anilist download -t "Death Note" --quality 1080 --episode-range "1-5" +\b + # Download with multiple filters + viu anilist download -g Action -T Isekai --score-greater 80 --status RELEASING +\b + # Download with concurrent downloads + viu anilist download -t "Demon Slayer" --episode-range "1-5" --max-concurrent 3 +\b + # Force redownload existing episodes + viu anilist download -t "Your Name" --episode-range "1" --force-redownload +\b + # Download from a specific season and year + viu anilist download --season WINTER --year 2024 -s POPULARITY_DESC +\b + # Download with genre filtering + viu anilist download -g Action -g Adventure --score-greater 75 +\b + # Download only completed series + viu anilist download -g Fantasy --status FINISHED --score-greater 75 +\b + # Download movies only + viu anilist download -F MOVIE -s SCORE_DESC --quality best +""" + + +search = """ +\b +\b\bExamples: + # Basic search by title + viu anilist search -t "Attack on Titan" +\b + # Search with multiple filters + viu anilist search -g Action -T Isekai --score-greater 75 --status RELEASING +\b + # Get anime with the tag of isekai + viu anilist search -T isekai +\b + # Get anime of 2024 and sort by popularity, finished or releasing, not in your list + viu anilist search -y 2024 -s POPULARITY_DESC --status RELEASING --status FINISHED --not-on-list +\b + # Get anime of 2024 season WINTER + viu anilist search -y 2024 --season WINTER +\b + # Get anime genre action and tag isekai,magic + viu anilist search -g Action -T Isekai -T Magic +\b + # Get anime of 2024 thats finished airing + viu anilist search -y 2024 -S FINISHED +\b + # Get the most favourite anime movies + viu anilist search -f MOVIE -s FAVOURITES_DESC +\b + # Search with score and popularity filters + viu anilist search --score-greater 80 --popularity-greater 50000 +\b + # Search excluding certain genres and tags + viu anilist search --genres-not Ecchi --tags-not "Hentai" +\b + # Search with date ranges (YYYYMMDD format) + viu anilist search --start-date-greater 20200101 --start-date-lesser 20241231 +\b + # Get only TV series, exclude certain statuses + viu anilist search -f TV --status-not CANCELLED --status-not HIATUS +\b + # Paginated search with custom page size + viu anilist search -g Action --page 2 --per-page 25 +\b + # Search for manga specifically + viu anilist search --media-type MANGA -g Fantasy +\b + # Complex search with multiple criteria + viu anilist search -t "demon" -g Action -g Supernatural --score-greater 70 --year 2020 -s SCORE_DESC +\b + # Dump search results as JSON instead of interactive mode + viu anilist search -g Action --dump-json +""" + + +main = """ +\b +\b\bExamples: + # ---- search ---- +\b + # Basic search by title + viu anilist search -t "Attack on Titan" +\b + # Search with multiple filters + viu anilist search -g Action -T Isekai --score-greater 75 --status RELEASING +\b + # Get anime with the tag of isekai + viu anilist search -T isekai +\b + # Get anime of 2024 and sort by popularity, finished or releasing, not in your list + viu anilist search -y 2024 -s POPULARITY_DESC --status RELEASING --status FINISHED --not-on-list +\b + # Get anime of 2024 season WINTER + viu anilist search -y 2024 --season WINTER +\b + # Get anime genre action and tag isekai,magic + viu anilist search -g Action -T Isekai -T Magic +\b + # Get anime of 2024 thats finished airing + viu anilist search -y 2024 -S FINISHED +\b + # Get the most favourite anime movies + viu anilist search -f MOVIE -s FAVOURITES_DESC +\b + # Search with score and popularity filters + viu anilist search --score-greater 80 --popularity-greater 50000 +\b + # Search excluding certain genres and tags + viu anilist search --genres-not Ecchi --tags-not "Hentai" +\b + # Search with date ranges (YYYYMMDD format) + viu anilist search --start-date-greater 20200101 --start-date-lesser 20241231 +\b + # Get only TV series, exclude certain statuses + viu anilist search -f TV --status-not CANCELLED --status-not HIATUS +\b + # Paginated search with custom page size + viu anilist search -g Action --page 2 --per-page 25 +\b + # Search for manga specifically + viu anilist search --media-type MANGA -g Fantasy +\b + # Complex search with multiple criteria + viu anilist search -t "demon" -g Action -g Supernatural --score-greater 70 --year 2020 -s SCORE_DESC +\b + # Dump search results as JSON instead of interactive mode + viu anilist search -g Action --dump-json +\b + # ---- login ---- +\b + # To sign in just run + viu anilist auth +\b + # To check your login status + viu anilist auth --status +\b + # To log out and erase credentials + viu anilist auth --logout +\b + # ---- notifier ---- +\b + # basic form + viu anilist notifier +\b + # with logging to stdout + viu --log anilist notifier +\b + # with logging to a file. stored in the same place as your config + viu --log-file anilist notifier +""" diff --git a/fastanime/cli/commands/completions.py b/viu/cli/commands/completions.py similarity index 79% rename from fastanime/cli/commands/completions.py rename to viu/cli/commands/completions.py index 78cafbe..19ea5a9 100644 --- a/fastanime/cli/commands/completions.py +++ b/viu/cli/commands/completions.py @@ -7,16 +7,16 @@ import click \b \b\bExamples: # try to detect your shell and print completions - fastanime completions + viu completions \b # print fish completions - fastanime completions --fish + viu completions --fish \b # print bash completions - fastanime completions --bash + viu completions --bash \b # print zsh completions - fastanime completions --zsh + viu completions --zsh """, ) @click.option("--fish", is_flag=True, help="print fish completions") @@ -40,8 +40,8 @@ def completions(fish, zsh, bash): if fish or (current_shell == "fish" and not zsh and not bash): print( """ -function _fastanime_completion; - set -l response (env _FASTANIME_COMPLETE=fish_complete COMP_WORDS=(commandline -cp) COMP_CWORD=(commandline -t) fastanime); +function _viu_completion; + set -l response (env _VIU_COMPLETE=fish_complete COMP_WORDS=(commandline -cp) COMP_CWORD=(commandline -t) viu); for completion in $response; set -l metadata (string split "," $completion); @@ -56,21 +56,21 @@ function _fastanime_completion; end; end; -complete --no-files --command fastanime --arguments "(_fastanime_completion)"; +complete --no-files --command viu --arguments "(_viu_completion)"; """ ) elif zsh or (current_shell == "zsh" and not bash): print( """ -#compdef fastanime +#compdef viu -_fastanime_completion() { +_viu_completion() { local -a completions local -a completions_with_descriptions local -a response - (( ! $+commands[fastanime] )) && return 1 + (( ! $+commands[viu] )) && return 1 - response=("${(@f)$(env COMP_WORDS="${words[*]}" COMP_CWORD=$((CURRENT-1)) _FASTANIME_COMPLETE=zsh_complete fastanime)}") + response=("${(@f)$(env COMP_WORDS="${words[*]}" COMP_CWORD=$((CURRENT-1)) _VIU_COMPLETE=zsh_complete viu)}") for type key descr in ${response}; do if [[ "$type" == "plain" ]]; then @@ -97,21 +97,21 @@ _fastanime_completion() { if [[ $zsh_eval_context[-1] == loadautofunc ]]; then # autoload from fpath, call function directly - _fastanime_completion "$@" + _viu_completion "$@" else # eval/source/. command, register function for later - compdef _fastanime_completion fastanime + compdef _viu_completion viu fi """ ) elif bash or current_shell == "bash": print( """ -_fastanime_completion() { +_viu_completion() { local IFS=$'\n' local response - response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD _FASTANIME_COMPLETE=bash_complete $1) + response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD _VIU_COMPLETE=bash_complete $1) for completion in $response; do IFS=',' read type value <<< "$completion" @@ -130,11 +130,11 @@ _fastanime_completion() { return 0 } -_fastanime_completion_setup() { - complete -o nosort -F _fastanime_completion fastanime +_viu_completion_setup() { + complete -o nosort -F _viu_completion viu } -_fastanime_completion_setup; +_viu_completion_setup; """ ) else: diff --git a/fastanime/cli/commands/config.py b/viu/cli/commands/config.py similarity index 89% rename from fastanime/cli/commands/config.py rename to viu/cli/commands/config.py index c97ce99..da3750f 100644 --- a/fastanime/cli/commands/config.py +++ b/viu/cli/commands/config.py @@ -11,25 +11,25 @@ from ...core.config import AppConfig \b\bExamples: # Edit your config in your default editor # NB: If it opens vim or vi exit with `:q` - fastanime config + viu config \b # Start the interactive configuration wizard - fastanime config --interactive + viu config --interactive \b # get the path of the config file - fastanime config --path + viu config --path \b # print desktop entry info - fastanime config --generate-desktop-entry + viu config --generate-desktop-entry \b # update your config without opening an editor - fastanime --icons --selector fzf --preview full config --update + viu --icons --selector fzf --preview full config --update \b # interactively define your config - fastanime config --interactive + viu config --interactive \b # view the current contents of your config - fastanime config --view + viu config --view """, ) @click.option("--path", "-p", help="Print the config location and exit", is_flag=True) @@ -45,13 +45,13 @@ from ...core.config import AppConfig @click.option( "--generate-desktop-entry", "-d", - help="Generate the desktop entry of fastanime", + help="Generate the desktop entry of viu", is_flag=True, ) @click.option( "--update", "-u", - help="Persist all the config options passed to fastanime to your config file", + help="Persist all the config options passed to viu to your config file", is_flag=True, ) @click.option( @@ -112,7 +112,7 @@ def config( def _generate_desktop_entry(): """ - Generates a desktop entry for FastAnime. + Generates a desktop entry for Viu. """ import shutil import sys @@ -130,11 +130,11 @@ def _generate_desktop_entry(): __version__, ) - EXECUTABLE = shutil.which("fastanime") + EXECUTABLE = shutil.which("viu") if EXECUTABLE: cmds = f"{EXECUTABLE} --selector rofi anilist" else: - cmds = f"{sys.executable} -m fastanime --selector rofi anilist" + cmds = f"{sys.executable} -m viu --selector rofi anilist" # TODO: Get funs of the other platforms to complete this lol if PLATFORM == "win32": diff --git a/fastanime/cli/commands/download.py b/viu/cli/commands/download.py similarity index 91% rename from fastanime/cli/commands/download.py rename to viu/cli/commands/download.py index 51e93e4..251a72e 100644 --- a/fastanime/cli/commands/download.py +++ b/viu/cli/commands/download.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING import click from ...core.config import AppConfig -from ...core.exceptions import FastAnimeError +from ...core.exceptions import ViuError from ..utils.completion import anime_titles_shell_complete from . import examples @@ -11,7 +11,7 @@ if TYPE_CHECKING: from pathlib import Path from typing import TypedDict - from fastanime.cli.service.feedback.service import FeedbackService + from viu.cli.service.feedback.service import FeedbackService from typing_extensions import Unpack from ...libs.provider.anime.base import BaseAnimeProvider @@ -103,9 +103,9 @@ if TYPE_CHECKING: ) @click.pass_obj def download(config: AppConfig, **options: "Unpack[Options]"): - from fastanime.cli.service.feedback.service import FeedbackService + from viu.cli.service.feedback.service import FeedbackService - from ...core.exceptions import FastAnimeError + from ...core.exceptions import ViuError from ...libs.provider.anime.params import ( AnimeParams, SearchParams, @@ -129,7 +129,7 @@ def download(config: AppConfig, **options: "Unpack[Options]"): ) ) if not search_results: - raise FastAnimeError("No results were found matching your query") + raise ViuError("No results were found matching your query") _search_results = { search_result.title: search_result @@ -140,7 +140,7 @@ def download(config: AppConfig, **options: "Unpack[Options]"): "Select Anime", list(_search_results.keys()) ) if not selected_anime_title: - raise FastAnimeError("No title selected") + raise ViuError("No title selected") anime_result = _search_results[selected_anime_title] # ---- fetch selected anime ---- @@ -148,7 +148,7 @@ def download(config: AppConfig, **options: "Unpack[Options]"): anime = provider.get(AnimeParams(id=anime_result.id, query=anime_title)) if not anime: - raise FastAnimeError(f"Failed to fetch anime {anime_result.title}") + raise ViuError(f"Failed to fetch anime {anime_result.title}") available_episodes: list[str] = sorted( getattr(anime.episodes, config.stream.translation_type), key=float @@ -174,14 +174,14 @@ def download(config: AppConfig, **options: "Unpack[Options]"): episode, ) except (ValueError, IndexError) as e: - raise FastAnimeError(f"Invalid episode range: {e}") from e + raise ViuError(f"Invalid episode range: {e}") from e else: episode = selector.choose( "Select Episode", getattr(anime.episodes, config.stream.translation_type), ) if not episode: - raise FastAnimeError("No episode selected") + raise ViuError("No episode selected") download_anime( config, options, @@ -219,7 +219,7 @@ def download_anime( ) ) if not streams: - raise FastAnimeError( + raise ViuError( f"Failed to get streams for anime: {anime.title}, episode: {episode}" ) @@ -227,7 +227,7 @@ def download_anime( with feedback.progress("Fetching top server"): server = next(streams, None) if not server: - raise FastAnimeError( + raise ViuError( f"Failed to get server for anime: {anime.title}, episode: {episode}" ) else: @@ -239,11 +239,11 @@ def download_anime( else: server_name = selector.choose("Select Server", servers_names) if not server_name: - raise FastAnimeError("Server not selected") + raise ViuError("Server not selected") server = servers[server_name] stream_link = server.links[0].link if not stream_link: - raise FastAnimeError( + raise ViuError( f"Failed to get stream link for anime: {anime.title}, episode: {episode}" ) feedback.info(f"[green bold]Now Downloading:[/] {anime.title} Episode: {episode}") diff --git a/fastanime/cli/commands/examples.py b/viu/cli/commands/examples.py similarity index 53% rename from fastanime/cli/commands/examples.py rename to viu/cli/commands/examples.py index f5760f4..e71ea1e 100644 --- a/fastanime/cli/commands/examples.py +++ b/viu/cli/commands/examples.py @@ -3,31 +3,31 @@ download = """ \b\bExamples: # Download all available episodes # multiple titles can be specified with -t option - fastanime download -t -t + viu download -t -t # -- or -- - fastanime download -t -t -r ':' + viu download -t -t -r ':' \b # download latest episode for the two anime titles # the number can be any no of latest episodes but a minus sign # must be present - fastanime download -t -t -r '-1' + viu download -t -t -r '-1' \b # latest 5 - fastanime download -t -t -r '-5' + viu download -t -t -r '-5' \b # Download specific episode range # be sure to observe the range Syntax - fastanime download -t -r '::' + viu download -t -r '::' \b - fastanime download -t -r ':' + viu download -t -r ':' \b - fastanime download -t -r ':' + viu download -t -r ':' \b - fastanime download -t -r ':' + viu download -t -r ':' \b # download specific episode # remember python indexing starts at 0 - fastanime download -t -r ':' + viu download -t -r ':' \b # merge subtitles with ffmpeg to mkv format; hianime tends to give subs as separate files # and dont prompt for anything @@ -35,36 +35,36 @@ download = """ # and clean # ie remove original files (sub file and vid file) # only keep merged files - fastanime download -t --merge --clean --no-prompt + viu download -t --merge --clean --no-prompt \b # EOF is used since -t always expects a title # you can supply anime titles from file or -t at the same time # from stdin - echo -e "\\n\\n" | fastanime download -t "EOF" -r -f - + echo -e "\\n\\n" | viu download -t "EOF" -r -f - \b # from file - fastanime download -t "EOF" -r -f + viu download -t "EOF" -r -f """ search = """ \b \b\bExamples: # basic form where you will still be prompted for the episode number # multiple titles can be specified with the -t option - fastanime search -t -t + viu search -t -t \b # binge all episodes with this command - fastanime search -t -r ':' + viu search -t -r ':' \b # watch latest episode - fastanime search -t -r '-1' + viu search -t -r '-1' \b # binge a specific episode range with this command # be sure to observe the range Syntax - fastanime search -t -r ':' + viu search -t -r ':' \b - fastanime search -t -r '::' + viu search -t -r '::' \b - fastanime search -t -r ':' + viu search -t -r ':' \b - fastanime search -t -r ':' + viu search -t -r ':' """ diff --git a/fastanime/cli/commands/queue.py b/viu/cli/commands/queue.py similarity index 90% rename from fastanime/cli/commands/queue.py rename to viu/cli/commands/queue.py index 8c617c3..dc85a8b 100644 --- a/fastanime/cli/commands/queue.py +++ b/viu/cli/commands/queue.py @@ -1,7 +1,7 @@ import click -from fastanime.core.config import AppConfig -from fastanime.core.exceptions import FastAnimeError -from fastanime.libs.media_api.types import ( +from viu.core.config import AppConfig +from viu.core.exceptions import ViuError +from viu.libs.media_api.types import ( MediaFormat, MediaGenre, MediaItem, @@ -15,7 +15,7 @@ from fastanime.libs.media_api.types import ( @click.command(help="Queue episodes for the background worker to download.") -# Search/Filter options (mirrors 'fastanime anilist download') +# Search/Filter options (mirrors 'viu anilist download') @click.option("--title", "-t") @click.option("--page", "-p", type=click.IntRange(min=1), default=1) @click.option("--per-page", type=click.IntRange(min=1, max=50)) @@ -72,14 +72,14 @@ def queue(config: AppConfig, **options): and queue the specified episode range for background download. The background worker should be running to process the queue. """ - from fastanime.cli.service.download.service import DownloadService - from fastanime.cli.service.feedback import FeedbackService - from fastanime.cli.service.registry import MediaRegistryService - from fastanime.cli.utils.parser import parse_episode_range - from fastanime.libs.media_api.params import MediaSearchParams - from fastanime.libs.media_api.api import create_api_client - from fastanime.libs.provider.anime.provider import create_provider - from fastanime.libs.selectors import create_selector + from viu.cli.service.download.service import DownloadService + from viu.cli.service.feedback import FeedbackService + from viu.cli.service.registry import MediaRegistryService + from viu.cli.utils.parser import parse_episode_range + from viu.libs.media_api.params import MediaSearchParams + from viu.libs.media_api.api import create_api_client + from viu.libs.provider.anime.provider import create_provider + from viu.libs.selectors import create_selector from rich.progress import Progress feedback = FeedbackService(config) @@ -140,7 +140,7 @@ def queue(config: AppConfig, **options): search_result = media_api.search_media(search_params) if not search_result or not search_result.media: - raise FastAnimeError("No anime found matching your search criteria.") + raise ViuError("No anime found matching your search criteria.") if options.get("yes"): anime_to_queue = search_result.media @@ -212,7 +212,7 @@ def queue(config: AppConfig, **options): f"Done. Total of {total_queued} episode(s) queued across all selections." ) - except FastAnimeError as e: + except ViuError as e: feedback.error("Queue command failed", str(e)) except Exception as e: feedback.error("An unexpected error occurred", str(e)) diff --git a/fastanime/cli/commands/queue/__init__.py b/viu/cli/commands/queue/__init__.py similarity index 100% rename from fastanime/cli/commands/queue/__init__.py rename to viu/cli/commands/queue/__init__.py diff --git a/fastanime/cli/commands/queue/cmd.py b/viu/cli/commands/queue/cmd.py similarity index 91% rename from fastanime/cli/commands/queue/cmd.py rename to viu/cli/commands/queue/cmd.py index 6ed0060..83ee6a5 100644 --- a/fastanime/cli/commands/queue/cmd.py +++ b/viu/cli/commands/queue/cmd.py @@ -13,7 +13,7 @@ commands = { @click.group( cls=LazyGroup, name="queue", - root="fastanime.cli.commands.queue.commands", + root="viu.cli.commands.queue.commands", invoke_without_command=False, help="Manage the download queue (add, list, resume, clear).", short_help="Manage the download queue.", diff --git a/fastanime/cli/commands/queue/commands/__init__.py b/viu/cli/commands/queue/commands/__init__.py similarity index 100% rename from fastanime/cli/commands/queue/commands/__init__.py rename to viu/cli/commands/queue/commands/__init__.py diff --git a/fastanime/cli/commands/queue/commands/add.py b/viu/cli/commands/queue/commands/add.py similarity index 90% rename from fastanime/cli/commands/queue/commands/add.py rename to viu/cli/commands/queue/commands/add.py index 24f2b5d..5edca2c 100644 --- a/fastanime/cli/commands/queue/commands/add.py +++ b/viu/cli/commands/queue/commands/add.py @@ -1,7 +1,7 @@ import click -from fastanime.core.config import AppConfig -from fastanime.core.exceptions import FastAnimeError -from fastanime.libs.media_api.types import ( +from viu.core.config import AppConfig +from viu.core.exceptions import ViuError +from viu.libs.media_api.types import ( MediaFormat, MediaGenre, MediaItem, @@ -70,14 +70,14 @@ from fastanime.libs.media_api.types import ( ) @click.pass_obj def add(config: AppConfig, **options): - from fastanime.cli.service.download import DownloadService - from fastanime.cli.service.feedback import FeedbackService - from fastanime.cli.service.registry import MediaRegistryService - from fastanime.cli.utils.parser import parse_episode_range - from fastanime.libs.media_api.api import create_api_client - from fastanime.libs.media_api.params import MediaSearchParams - from fastanime.libs.provider.anime.provider import create_provider - from fastanime.libs.selectors import create_selector + from viu.cli.service.download import DownloadService + from viu.cli.service.feedback import FeedbackService + from viu.cli.service.registry import MediaRegistryService + from viu.cli.utils.parser import parse_episode_range + from viu.libs.media_api.api import create_api_client + from viu.libs.media_api.params import MediaSearchParams + from viu.libs.provider.anime.provider import create_provider + from viu.libs.selectors import create_selector from rich.progress import Progress feedback = FeedbackService(config) @@ -138,7 +138,7 @@ def add(config: AppConfig, **options): search_result = media_api.search_media(search_params) if not search_result or not search_result.media: - raise FastAnimeError("No anime found matching your search criteria.") + raise ViuError("No anime found matching your search criteria.") if options.get("yes"): anime_to_queue = search_result.media @@ -149,7 +149,7 @@ def add(config: AppConfig, **options): } preview_command = None if config.general.preview != "none": - from fastanime.cli.utils.preview import create_preview_context + from viu.cli.utils.preview import create_preview_context with create_preview_context() as preview_ctx: preview_command = preview_ctx.get_anime_preview( @@ -211,7 +211,7 @@ def add(config: AppConfig, **options): f"Done. Total of {total_queued} episode(s) queued across all selections." ) - except FastAnimeError as e: + except ViuError as e: feedback.error("Queue add failed", str(e)) except Exception as e: feedback.error("An unexpected error occurred", str(e)) diff --git a/fastanime/cli/commands/queue/commands/clear.py b/viu/cli/commands/queue/commands/clear.py similarity index 79% rename from fastanime/cli/commands/queue/commands/clear.py rename to viu/cli/commands/queue/commands/clear.py index 60f9783..33d04a3 100644 --- a/fastanime/cli/commands/queue/commands/clear.py +++ b/viu/cli/commands/queue/commands/clear.py @@ -1,14 +1,14 @@ import click -from fastanime.core.config import AppConfig +from viu.core.config import AppConfig @click.command(name="clear", help="Clear queued items from the registry (QUEUED -> NOT_DOWNLOADED).") @click.option("--force", is_flag=True, help="Do not prompt for confirmation.") @click.pass_obj def clear_cmd(config: AppConfig, force: bool): - from fastanime.cli.service.feedback import FeedbackService - from fastanime.cli.service.registry import MediaRegistryService - from fastanime.cli.service.registry.models import DownloadStatus + from viu.cli.service.feedback import FeedbackService + from viu.cli.service.registry import MediaRegistryService + from viu.cli.service.registry.models import DownloadStatus feedback = FeedbackService(config) registry = MediaRegistryService(config.general.media_api, config.media_registry) diff --git a/fastanime/cli/commands/queue/commands/list.py b/viu/cli/commands/queue/commands/list.py similarity index 89% rename from fastanime/cli/commands/queue/commands/list.py rename to viu/cli/commands/queue/commands/list.py index b67cff0..90a87e1 100644 --- a/fastanime/cli/commands/queue/commands/list.py +++ b/viu/cli/commands/queue/commands/list.py @@ -1,5 +1,5 @@ import click -from fastanime.core.config import AppConfig +from viu.core.config import AppConfig @click.command(name="list", help="List items in the download queue and their statuses.") @@ -10,9 +10,9 @@ from fastanime.core.config import AppConfig @click.option("--detailed", is_flag=True) @click.pass_obj def list_cmd(config: AppConfig, status: str | None, detailed: bool | None): - from fastanime.cli.service.feedback import FeedbackService - from fastanime.cli.service.registry import MediaRegistryService - from fastanime.cli.service.registry.models import DownloadStatus + from viu.cli.service.feedback import FeedbackService + from viu.cli.service.registry import MediaRegistryService + from viu.cli.service.registry.models import DownloadStatus feedback = FeedbackService(config) registry = MediaRegistryService(config.general.media_api, config.media_registry) diff --git a/fastanime/cli/commands/queue/commands/resume.py b/viu/cli/commands/queue/commands/resume.py similarity index 62% rename from fastanime/cli/commands/queue/commands/resume.py rename to viu/cli/commands/queue/commands/resume.py index c8d267b..b28dab3 100644 --- a/fastanime/cli/commands/queue/commands/resume.py +++ b/viu/cli/commands/queue/commands/resume.py @@ -1,15 +1,15 @@ import click -from fastanime.core.config import AppConfig +from viu.core.config import AppConfig @click.command(name="resume", help="Submit any queued or in-progress downloads to the worker.") @click.pass_obj def resume(config: AppConfig): - from fastanime.cli.service.download.service import DownloadService - from fastanime.cli.service.feedback import FeedbackService - from fastanime.cli.service.registry import MediaRegistryService - from fastanime.libs.media_api.api import create_api_client - from fastanime.libs.provider.anime.provider import create_provider + from viu.cli.service.download.service import DownloadService + from viu.cli.service.feedback import FeedbackService + from viu.cli.service.registry import MediaRegistryService + from viu.libs.media_api.api import create_api_client + from viu.libs.provider.anime.provider import create_provider feedback = FeedbackService(config) media_api = create_api_client(config.general.media_api, config) diff --git a/fastanime/cli/commands/registry/__init__.py b/viu/cli/commands/registry/__init__.py similarity index 100% rename from fastanime/cli/commands/registry/__init__.py rename to viu/cli/commands/registry/__init__.py diff --git a/fastanime/cli/commands/registry/cmd.py b/viu/cli/commands/registry/cmd.py similarity index 97% rename from fastanime/cli/commands/registry/cmd.py rename to viu/cli/commands/registry/cmd.py index 5ba173f..a9f1954 100644 --- a/fastanime/cli/commands/registry/cmd.py +++ b/viu/cli/commands/registry/cmd.py @@ -19,7 +19,7 @@ commands = { @click.group( cls=LazyGroup, name="registry", - root="fastanime.cli.commands.registry.commands", + root="viu.cli.commands.registry.commands", invoke_without_command=True, help="Manage your local media registry - sync, search, backup and maintain your anime database", short_help="Local media registry management", diff --git a/fastanime/cli/commands/registry/commands/__init__.py b/viu/cli/commands/registry/commands/__init__.py similarity index 100% rename from fastanime/cli/commands/registry/commands/__init__.py rename to viu/cli/commands/registry/commands/__init__.py diff --git a/fastanime/cli/commands/registry/commands/backup.py b/viu/cli/commands/registry/commands/backup.py similarity index 98% rename from fastanime/cli/commands/registry/commands/backup.py rename to viu/cli/commands/registry/commands/backup.py index 9609e12..4b3f6b1 100644 --- a/fastanime/cli/commands/registry/commands/backup.py +++ b/viu/cli/commands/registry/commands/backup.py @@ -69,7 +69,7 @@ def backup( ) if backup_format == "zip": extension = "zip" - output = f"fastanime_registry_backup_{api}_{timestamp}.{extension}" + output = f"viu_registry_backup_{api}_{timestamp}.{extension}" output_path = Path(output) @@ -208,7 +208,7 @@ def _create_backup_metadata( return { "backup_timestamp": datetime.now().isoformat(), - "fastanime_version": __version__, + "viu_version": __version__, "registry_version": stats.get("version"), "api": api, "total_media": stats.get("total_media", 0), diff --git a/fastanime/cli/commands/registry/commands/clean.py b/viu/cli/commands/registry/commands/clean.py similarity index 100% rename from fastanime/cli/commands/registry/commands/clean.py rename to viu/cli/commands/registry/commands/clean.py diff --git a/fastanime/cli/commands/registry/commands/export.py b/viu/cli/commands/registry/commands/export.py similarity index 98% rename from fastanime/cli/commands/registry/commands/export.py rename to viu/cli/commands/registry/commands/export.py index 9590e56..a5356c4 100644 --- a/fastanime/cli/commands/registry/commands/export.py +++ b/viu/cli/commands/registry/commands/export.py @@ -78,7 +78,7 @@ def export( extension = output_format.lower() if compress: extension += ".gz" - output_path = Path(f"fastanime_registry_{api}_{timestamp}.{extension}") + output_path = Path(f"viu_registry_{api}_{timestamp}.{extension}") else: output_path = output @@ -230,7 +230,7 @@ def _export_xml(data: dict, output_path: Path): """Export data to XML format.""" import xml.etree.ElementTree as ET - root = ET.Element("fastanime_registry") + root = ET.Element("viu_registry") # Add metadata metadata_elem = ET.SubElement(root, "metadata") diff --git a/fastanime/cli/commands/registry/commands/import_.py b/viu/cli/commands/registry/commands/import_.py similarity index 99% rename from fastanime/cli/commands/registry/commands/import_.py rename to viu/cli/commands/registry/commands/import_.py index f320a29..ba46e2a 100644 --- a/fastanime/cli/commands/registry/commands/import_.py +++ b/viu/cli/commands/registry/commands/import_.py @@ -109,7 +109,7 @@ def _create_backup( from .export import _export_json, _prepare_export_data timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") - backup_path = Path(f"fastanime_registry_pre_import_{api}_{timestamp}.json") + backup_path = Path(f"viu_registry_pre_import_{api}_{timestamp}.json") export_data = _prepare_export_data(registry_service, True, ()) _export_json(export_data, backup_path) diff --git a/fastanime/cli/commands/registry/commands/restore.py b/viu/cli/commands/registry/commands/restore.py similarity index 99% rename from fastanime/cli/commands/registry/commands/restore.py rename to viu/cli/commands/registry/commands/restore.py index 1aa7b94..d04ea37 100644 --- a/fastanime/cli/commands/registry/commands/restore.py +++ b/viu/cli/commands/registry/commands/restore.py @@ -177,7 +177,7 @@ def _backup_current_registry( from .backup import _create_tar_backup timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") - backup_path = Path(f"fastanime_registry_pre_restore_{api}_{timestamp}.tar.gz") + backup_path = Path(f"viu_registry_pre_restore_{api}_{timestamp}.tar.gz") try: _create_tar_backup(registry_service, backup_path, True, False, feedback, api) diff --git a/fastanime/cli/commands/registry/commands/search.py b/viu/cli/commands/registry/commands/search.py similarity index 100% rename from fastanime/cli/commands/registry/commands/search.py rename to viu/cli/commands/registry/commands/search.py diff --git a/fastanime/cli/commands/registry/commands/stats.py b/viu/cli/commands/registry/commands/stats.py similarity index 100% rename from fastanime/cli/commands/registry/commands/stats.py rename to viu/cli/commands/registry/commands/stats.py diff --git a/fastanime/cli/commands/registry/commands/sync.py b/viu/cli/commands/registry/commands/sync.py similarity index 98% rename from fastanime/cli/commands/registry/commands/sync.py rename to viu/cli/commands/registry/commands/sync.py index 0393e93..d9cdefb 100644 --- a/fastanime/cli/commands/registry/commands/sync.py +++ b/viu/cli/commands/registry/commands/sync.py @@ -3,8 +3,8 @@ Registry sync command - synchronize local registry with remote media API """ import click -from fastanime.cli.service.feedback.service import FeedbackService -from fastanime.cli.service.registry.service import MediaRegistryService +from viu.cli.service.feedback.service import FeedbackService +from viu.cli.service.registry.service import MediaRegistryService from .....core.config import AppConfig @@ -78,7 +78,7 @@ def sync( "Authentication Required", f"You must be logged in to {api} to sync your media list.", ) - feedback.info("Run this command to authenticate:", f"fastanime {api} auth") + feedback.info("Run this command to authenticate:", f"viu {api} auth") raise click.Abort() # Determine which statuses to sync diff --git a/viu/cli/commands/registry/examples.py b/viu/cli/commands/registry/examples.py new file mode 100644 index 0000000..a0a2fff --- /dev/null +++ b/viu/cli/commands/registry/examples.py @@ -0,0 +1,31 @@ +""" +Example usage for the registry command +""" + +main = """ + +Examples: + # Sync with remote AniList + viu registry sync --upload --download + + # Show detailed registry statistics + viu registry stats --detailed + + # Search local registry + viu registry search "attack on titan" + + # Export registry to JSON + viu registry export --format json --output backup.json + + # Import from backup + viu registry import backup.json + + # Clean up orphaned entries + viu registry clean --dry-run + + # Create full backup + viu registry backup --compress + + # Restore from backup + viu registry restore backup.tar.gz +""" diff --git a/fastanime/cli/commands/search.py b/viu/cli/commands/search.py similarity index 87% rename from fastanime/cli/commands/search.py rename to viu/cli/commands/search.py index 586bada..cbf44e7 100644 --- a/fastanime/cli/commands/search.py +++ b/viu/cli/commands/search.py @@ -3,14 +3,14 @@ from typing import TYPE_CHECKING import click from ...core.config import AppConfig -from ...core.exceptions import FastAnimeError +from ...core.exceptions import ViuError from ..utils.completion import anime_titles_shell_complete from . import examples if TYPE_CHECKING: from typing import TypedDict - from fastanime.cli.service.feedback.service import FeedbackService + from viu.cli.service.feedback.service import FeedbackService from typing_extensions import Unpack from ...libs.provider.anime.base import BaseAnimeProvider @@ -42,9 +42,9 @@ if TYPE_CHECKING: ) @click.pass_obj def search(config: AppConfig, **options: "Unpack[Options]"): - from fastanime.cli.service.feedback.service import FeedbackService + from viu.cli.service.feedback.service import FeedbackService - from ...core.exceptions import FastAnimeError + from ...core.exceptions import ViuError from ...libs.provider.anime.params import ( AnimeParams, SearchParams, @@ -68,7 +68,7 @@ def search(config: AppConfig, **options: "Unpack[Options]"): ) ) if not search_results: - raise FastAnimeError("No results were found matching your query") + raise ViuError("No results were found matching your query") _search_results = { search_result.title: search_result @@ -79,7 +79,7 @@ def search(config: AppConfig, **options: "Unpack[Options]"): "Select Anime", list(_search_results.keys()) ) if not selected_anime_title: - raise FastAnimeError("No title selected") + raise ViuError("No title selected") anime_result = _search_results[selected_anime_title] # ---- fetch selected anime ---- @@ -87,7 +87,7 @@ def search(config: AppConfig, **options: "Unpack[Options]"): anime = provider.get(AnimeParams(id=anime_result.id, query=anime_title)) if not anime: - raise FastAnimeError(f"Failed to fetch anime {anime_result.title}") + raise ViuError(f"Failed to fetch anime {anime_result.title}") available_episodes: list[str] = sorted( getattr(anime.episodes, config.stream.translation_type), key=float @@ -112,14 +112,14 @@ def search(config: AppConfig, **options: "Unpack[Options]"): anime_title, ) except (ValueError, IndexError) as e: - raise FastAnimeError(f"Invalid episode range: {e}") from e + raise ViuError(f"Invalid episode range: {e}") from e else: episode = selector.choose( "Select Episode", getattr(anime.episodes, config.stream.translation_type), ) if not episode: - raise FastAnimeError("No episode selected") + raise ViuError("No episode selected") stream_anime( config, provider, selector, feedback, anime, episode, anime_title ) @@ -134,7 +134,7 @@ def stream_anime( episode: str, anime_title: str, ): - from fastanime.cli.service.player.service import PlayerService + from viu.cli.service.player.service import PlayerService from ...libs.player.params import PlayerParams from ...libs.provider.anime.params import EpisodeStreamsParams @@ -151,7 +151,7 @@ def stream_anime( ) ) if not streams: - raise FastAnimeError( + raise ViuError( f"Failed to get streams for anime: {anime.title}, episode: {episode}" ) @@ -159,7 +159,7 @@ def stream_anime( with feedback.progress("Fetching top server"): server = next(streams, None) if not server: - raise FastAnimeError( + raise ViuError( f"Failed to get server for anime: {anime.title}, episode: {episode}" ) else: @@ -171,11 +171,11 @@ def stream_anime( else: server_name = selector.choose("Select Server", servers_names) if not server_name: - raise FastAnimeError("Server not selected") + raise ViuError("Server not selected") server = servers[server_name] stream_link = server.links[0].link if not stream_link: - raise FastAnimeError( + raise ViuError( f"Failed to get stream link for anime: {anime.title}, episode: {episode}" ) feedback.info(f"[green bold]Now Streaming:[/] {anime.title} Episode: {episode}") diff --git a/fastanime/cli/commands/update.py b/viu/cli/commands/update.py similarity index 92% rename from fastanime/cli/commands/update.py rename to viu/cli/commands/update.py index 4dadf43..658ef96 100644 --- a/fastanime/cli/commands/update.py +++ b/viu/cli/commands/update.py @@ -1,4 +1,4 @@ -"""Update command for FastAnime CLI.""" +"""Update command for Viu CLI.""" import sys from typing import TYPE_CHECKING @@ -15,22 +15,22 @@ if TYPE_CHECKING: @click.command( - help="Update FastAnime to the latest version", - short_help="Update FastAnime", + help="Update Viu to the latest version", + short_help="Update Viu", epilog=""" \b \b\bExamples: # Check for updates and update if available - fastanime update + viu update \b # Force update even if already up to date - fastanime update --force + viu update --force \b # Only check for updates without updating - fastanime update --check-only + viu update --check-only \b # Show release notes for the latest version - fastanime update --release-notes + viu update --release-notes """, ) @click.option( @@ -61,7 +61,7 @@ def update( release_notes: bool, ) -> None: """ - Update FastAnime to the latest version. + Update Viu to the latest version. This command checks for available updates and optionally updates the application to the latest version from the configured sources @@ -117,14 +117,14 @@ def update( sys.exit(1) if is_latest: - print("[green]FastAnime is up to date![/]") + print("[green]Viu is up to date![/]") print( f"[dim]Current version: {release_json.get('tag_name', 'unknown')}[/]" ) else: latest_version = release_json.get("tag_name", "unknown") print(f"[yellow]Update available: {latest_version}[/]") - print("[dim]Run 'fastanime update' to update[/]") + print("[dim]Run 'viu update' to update[/]") sys.exit(1) else: print("[cyan]Checking for updates and updating if necessary...[/]") diff --git a/fastanime/cli/commands/worker.py b/viu/cli/commands/worker.py similarity index 67% rename from fastanime/cli/commands/worker.py rename to viu/cli/commands/worker.py index 849c0f7..bad9feb 100644 --- a/fastanime/cli/commands/worker.py +++ b/viu/cli/commands/worker.py @@ -1,5 +1,5 @@ import click -from fastanime.core.config import AppConfig +from viu.core.config import AppConfig @click.command(help="Run the background worker for notifications and downloads.") @@ -9,16 +9,16 @@ def worker(config: AppConfig): Starts the long-running background worker process. This process will periodically check for AniList notifications and process any queued downloads. It's recommended to run this in the - background (e.g., 'fastanime worker &') or as a system service. + background (e.g., 'viu worker &') or as a system service. """ - from fastanime.cli.service.auth import AuthService - from fastanime.cli.service.download.service import DownloadService - from fastanime.cli.service.feedback import FeedbackService - from fastanime.cli.service.notification.service import NotificationService - from fastanime.cli.service.registry.service import MediaRegistryService - from fastanime.cli.service.worker.service import BackgroundWorkerService - from fastanime.libs.media_api.api import create_api_client - from fastanime.libs.provider.anime.provider import create_provider + from viu.cli.service.auth import AuthService + from viu.cli.service.download.service import DownloadService + from viu.cli.service.feedback import FeedbackService + from viu.cli.service.notification.service import NotificationService + from viu.cli.service.registry.service import MediaRegistryService + from viu.cli.service.worker.service import BackgroundWorkerService + from viu.libs.media_api.api import create_api_client + from viu.libs.provider.anime.provider import create_provider feedback = FeedbackService(config) if not config.worker.enabled: diff --git a/fastanime/cli/config/__init__.py b/viu/cli/config/__init__.py similarity index 100% rename from fastanime/cli/config/__init__.py rename to viu/cli/config/__init__.py diff --git a/fastanime/cli/config/editor.py b/viu/cli/config/editor.py similarity index 98% rename from fastanime/cli/config/editor.py rename to viu/cli/config/editor.py index dcce5bd..e8fb4f0 100644 --- a/fastanime/cli/config/editor.py +++ b/viu/cli/config/editor.py @@ -20,7 +20,7 @@ class InteractiveConfigEditor: def run(self) -> AppConfig: """Starts the interactive configuration wizard.""" print( - "[bold cyan]Welcome to the FastAnime Interactive Configurator![/bold cyan]" + "[bold cyan]Welcome to the Viu Interactive Configurator![/bold cyan]" ) print("Let's set up your experience. Press Ctrl+C at any time to exit.") print("Current values will be shown as defaults.") diff --git a/fastanime/cli/config/generate.py b/viu/cli/config/generate.py similarity index 98% rename from fastanime/cli/config/generate.py rename to viu/cli/config/generate.py index 9bdb4c5..1916a59 100644 --- a/fastanime/cli/config/generate.py +++ b/viu/cli/config/generate.py @@ -19,7 +19,7 @@ CONFIG_HEADER = f""" # # ============================================================================== # This file was auto-generated from the application's configuration model. -# You can modify these values to customize the behavior of FastAnime. +# You can modify these values to customize the behavior of Viu. # For path-based options, you can use '~' for your home directory. """.lstrip() diff --git a/fastanime/cli/config/loader.py b/viu/cli/config/loader.py similarity index 97% rename from fastanime/cli/config/loader.py rename to viu/cli/config/loader.py index 208dd0f..11de6f0 100644 --- a/fastanime/cli/config/loader.py +++ b/viu/cli/config/loader.py @@ -38,7 +38,7 @@ class ConfigLoader: def _handle_first_run(self) -> AppConfig: """Handles the configuration process when no config file is found.""" click.echo( - "[bold yellow]Welcome to FastAnime![/bold yellow] No configuration file found." + "[bold yellow]Welcome to Viu![/bold yellow] No configuration file found." ) from InquirerPy import inquirer diff --git a/fastanime/cli/interactive/menu/media/download_episodes.py b/viu/cli/interactive/menu/media/download_episodes.py similarity index 100% rename from fastanime/cli/interactive/menu/media/download_episodes.py rename to viu/cli/interactive/menu/media/download_episodes.py diff --git a/fastanime/cli/interactive/menu/media/downloads.py b/viu/cli/interactive/menu/media/downloads.py similarity index 100% rename from fastanime/cli/interactive/menu/media/downloads.py rename to viu/cli/interactive/menu/media/downloads.py diff --git a/fastanime/cli/interactive/menu/media/dynamic_search.py b/viu/cli/interactive/menu/media/dynamic_search.py similarity index 100% rename from fastanime/cli/interactive/menu/media/dynamic_search.py rename to viu/cli/interactive/menu/media/dynamic_search.py diff --git a/fastanime/cli/interactive/menu/media/episodes.py b/viu/cli/interactive/menu/media/episodes.py similarity index 100% rename from fastanime/cli/interactive/menu/media/episodes.py rename to viu/cli/interactive/menu/media/episodes.py diff --git a/fastanime/cli/interactive/menu/media/main.py b/viu/cli/interactive/menu/media/main.py similarity index 100% rename from fastanime/cli/interactive/menu/media/main.py rename to viu/cli/interactive/menu/media/main.py diff --git a/fastanime/cli/interactive/menu/media/media_actions.py b/viu/cli/interactive/menu/media/media_actions.py similarity index 100% rename from fastanime/cli/interactive/menu/media/media_actions.py rename to viu/cli/interactive/menu/media/media_actions.py diff --git a/fastanime/cli/interactive/menu/media/media_airing_schedule.py b/viu/cli/interactive/menu/media/media_airing_schedule.py similarity index 100% rename from fastanime/cli/interactive/menu/media/media_airing_schedule.py rename to viu/cli/interactive/menu/media/media_airing_schedule.py diff --git a/fastanime/cli/interactive/menu/media/media_characters.py b/viu/cli/interactive/menu/media/media_characters.py similarity index 100% rename from fastanime/cli/interactive/menu/media/media_characters.py rename to viu/cli/interactive/menu/media/media_characters.py diff --git a/fastanime/cli/interactive/menu/media/media_review.py b/viu/cli/interactive/menu/media/media_review.py similarity index 100% rename from fastanime/cli/interactive/menu/media/media_review.py rename to viu/cli/interactive/menu/media/media_review.py diff --git a/fastanime/cli/interactive/menu/media/play_downloads.py b/viu/cli/interactive/menu/media/play_downloads.py similarity index 100% rename from fastanime/cli/interactive/menu/media/play_downloads.py rename to viu/cli/interactive/menu/media/play_downloads.py diff --git a/fastanime/cli/interactive/menu/media/player_controls.py b/viu/cli/interactive/menu/media/player_controls.py similarity index 100% rename from fastanime/cli/interactive/menu/media/player_controls.py rename to viu/cli/interactive/menu/media/player_controls.py diff --git a/fastanime/cli/interactive/menu/media/provider_search.py b/viu/cli/interactive/menu/media/provider_search.py similarity index 100% rename from fastanime/cli/interactive/menu/media/provider_search.py rename to viu/cli/interactive/menu/media/provider_search.py diff --git a/fastanime/cli/interactive/menu/media/results.py b/viu/cli/interactive/menu/media/results.py similarity index 100% rename from fastanime/cli/interactive/menu/media/results.py rename to viu/cli/interactive/menu/media/results.py diff --git a/fastanime/cli/interactive/menu/media/servers.py b/viu/cli/interactive/menu/media/servers.py similarity index 100% rename from fastanime/cli/interactive/menu/media/servers.py rename to viu/cli/interactive/menu/media/servers.py diff --git a/fastanime/cli/interactive/session.py b/viu/cli/interactive/session.py similarity index 99% rename from fastanime/cli/interactive/session.py rename to viu/cli/interactive/session.py index 5f474ec..098f0e4 100644 --- a/fastanime/cli/interactive/session.py +++ b/viu/cli/interactive/session.py @@ -309,7 +309,7 @@ class Session: if filename.endswith(".py") and not filename.startswith("__"): module_name = filename[:-3] full_module_name = ( - f"fastanime.cli.interactive.menu.{package_name}.{module_name}" + f"viu.cli.interactive.menu.{package_name}.{module_name}" ) file_path = package_path / filename diff --git a/fastanime/cli/interactive/state.py b/viu/cli/interactive/state.py similarity index 100% rename from fastanime/cli/interactive/state.py rename to viu/cli/interactive/state.py diff --git a/fastanime/cli/options.py b/viu/cli/options.py similarity index 100% rename from fastanime/cli/options.py rename to viu/cli/options.py diff --git a/fastanime/cli/service/auth/__init__.py b/viu/cli/service/auth/__init__.py similarity index 100% rename from fastanime/cli/service/auth/__init__.py rename to viu/cli/service/auth/__init__.py diff --git a/fastanime/cli/service/auth/model.py b/viu/cli/service/auth/model.py similarity index 100% rename from fastanime/cli/service/auth/model.py rename to viu/cli/service/auth/model.py diff --git a/fastanime/cli/service/auth/service.py b/viu/cli/service/auth/service.py similarity index 100% rename from fastanime/cli/service/auth/service.py rename to viu/cli/service/auth/service.py diff --git a/fastanime/cli/service/download/__init__.py b/viu/cli/service/download/__init__.py similarity index 100% rename from fastanime/cli/service/download/__init__.py rename to viu/cli/service/download/__init__.py diff --git a/fastanime/cli/service/download/service.py b/viu/cli/service/download/service.py similarity index 97% rename from fastanime/cli/service/download/service.py rename to viu/cli/service/download/service.py index 3d7e7d1..dfbbe63 100644 --- a/fastanime/cli/service/download/service.py +++ b/viu/cli/service/download/service.py @@ -127,7 +127,7 @@ class DownloadService: self._submit_download(record.media_item, episode_number) else: logger.error( - f"Could not find metadata for media ID {media_id}. Cannot resume. Please run 'fastanime registry sync'." + f"Could not find metadata for media ID {media_id}. Cannot resume. Please run 'viu registry sync'." ) def retry_failed_downloads(self): @@ -170,7 +170,7 @@ class DownloadService: else: logger.error( - f"Could not find metadata for media ID {media_id}. Cannot resume. Please run 'fastanime registry sync'." + f"Could not find metadata for media ID {media_id}. Cannot resume. Please run 'viu registry sync'." ) def _execute_download_job(self, media_item: MediaItem, episode_number: str): @@ -297,9 +297,9 @@ class DownloadService: app_icon = str(icon_path) if icon_path else None notification.notify( # type: ignore - title="FastAnime: New Episode", + title="Viu: New Episode", message=message, - app_name="FastAnime", + app_name="Viu", app_icon=app_icon, timeout=self.app_config.general.desktop_notification_duration * 60, @@ -319,9 +319,9 @@ class DownloadService: app_icon = str(icon_path) if icon_path else None notification.notify( # type: ignore - title="FastAnime: New Episode", + title="Viu: New Episode", message=message, - app_name="FastAnime", + app_name="Viu", app_icon=app_icon, timeout=self.app_config.general.desktop_notification_duration * 60, ) diff --git a/fastanime/cli/service/feedback/__init__.py b/viu/cli/service/feedback/__init__.py similarity index 100% rename from fastanime/cli/service/feedback/__init__.py rename to viu/cli/service/feedback/__init__.py diff --git a/fastanime/cli/service/feedback/service.py b/viu/cli/service/feedback/service.py similarity index 100% rename from fastanime/cli/service/feedback/service.py rename to viu/cli/service/feedback/service.py diff --git a/fastanime/cli/service/notification/service.py b/viu/cli/service/notification/service.py similarity index 92% rename from fastanime/cli/service/notification/service.py rename to viu/cli/service/notification/service.py index a6a1127..602c13d 100644 --- a/fastanime/cli/service/notification/service.py +++ b/viu/cli/service/notification/service.py @@ -3,12 +3,12 @@ from pathlib import Path from typing import Optional import httpx -from fastanime.cli.service.registry import MediaRegistryService -from fastanime.cli.service.registry.models import DownloadStatus -from fastanime.core.config.model import AppConfig -from fastanime.core.constants import APP_CACHE_DIR -from fastanime.libs.media_api.base import BaseApiClient -from fastanime.libs.media_api.types import MediaItem, Notification +from viu.cli.service.registry import MediaRegistryService +from viu.cli.service.registry.models import DownloadStatus +from viu.core.config.model import AppConfig +from viu.core.constants import APP_CACHE_DIR +from viu.libs.media_api.base import BaseApiClient +from viu.libs.media_api.types import MediaItem, Notification try: from plyer import notification as plyer_notification @@ -97,9 +97,9 @@ class NotificationService: # Assert for type checkers and runtime safety assert plyer_notification is not None plyer_notification.notify( # type: ignore - title="FastAnime: New Episode", + title="Viu: New Episode", message=message, - app_name="FastAnime", + app_name="Viu", app_icon=app_icon, # plyer supports file paths or URLs depending on platform timeout=self.app_config.general.desktop_notification_duration * 60, ) diff --git a/fastanime/cli/service/player/__init__.py b/viu/cli/service/player/__init__.py similarity index 100% rename from fastanime/cli/service/player/__init__.py rename to viu/cli/service/player/__init__.py diff --git a/fastanime/cli/service/player/ipc/base.py b/viu/cli/service/player/ipc/base.py similarity index 100% rename from fastanime/cli/service/player/ipc/base.py rename to viu/cli/service/player/ipc/base.py diff --git a/fastanime/cli/service/player/ipc/mpv.py b/viu/cli/service/player/ipc/mpv.py similarity index 96% rename from fastanime/cli/service/player/ipc/mpv.py rename to viu/cli/service/player/ipc/mpv.py index 45e9394..cb8d8ca 100644 --- a/fastanime/cli/service/player/ipc/mpv.py +++ b/viu/cli/service/player/ipc/mpv.py @@ -1,5 +1,5 @@ """ -IPC-based MPV Player implementation for FastAnime. +IPC-based MPV Player implementation for Viu. This provides advanced features like episode navigation, quality switching, and auto-next. """ @@ -16,7 +16,7 @@ from queue import Empty, Queue from typing import Any, Callable, Dict, List, Literal, Optional from .....core.config.model import StreamConfig -from .....core.exceptions import FastAnimeError +from .....core.exceptions import ViuError from .....core.utils import formatter from .....libs.media_api.types import MediaItem from .....libs.player.base import BasePlayer @@ -32,7 +32,7 @@ from .base import BaseIPCPlayer logger = logging.getLogger(__name__) -class MPVIPCError(FastAnimeError): +class MPVIPCError(ViuError): """Exception raised for MPV IPC communication errors.""" pass @@ -362,36 +362,36 @@ class MpvIPCPlayer(BaseIPCPlayer): def _setup_key_bindings(self): key_bindings = { - "shift+n": ("script-message fastanime-next-episode", "Next Episode"), + "shift+n": ("script-message viu-next-episode", "Next Episode"), "shift+p": ( - "script-message fastanime-previous-episode", + "script-message viu-previous-episode", "Previous Episode", ), "shift+a": ( - "script-message fastanime-toggle-auto-next", + "script-message viu-toggle-auto-next", "Toggle Auto-Next", ), "shift+t": ( - "script-message fastanime-toggle-translation", + "script-message viu-toggle-translation", "Toggle Translation", ), - "shift+r": ("script-message fastanime-reload-episode", "Reload Episode"), + "shift+r": ("script-message viu-reload-episode", "Reload Episode"), } for key, (command, description) in key_bindings.items(): self._bind_key(key, command, description) self._show_text( - "FastAnime IPC: Shift+N=Next, Shift+P=Prev, Shift+R=Reload", 3000 + "Viu IPC: Shift+N=Next, Shift+P=Prev, Shift+R=Reload", 3000 ) def _setup_message_handlers(self): self.message_handlers.update( { - "fastanime-next-episode": self._next_episode, - "fastanime-previous-episode": self._previous_episode, - "fastanime-reload-episode": self._reload_episode, - "fastanime-toggle-auto-next": self._toggle_auto_next, - "fastanime-toggle-translation": self._toggle_translation_type, + "viu-next-episode": self._next_episode, + "viu-previous-episode": self._previous_episode, + "viu-reload-episode": self._reload_episode, + "viu-toggle-auto-next": self._toggle_auto_next, + "viu-toggle-translation": self._toggle_translation_type, "select-episode": self._handle_select_episode, "select-server": self._handle_select_server, "select-quality": self._handle_select_quality, diff --git a/fastanime/cli/service/player/service.py b/viu/cli/service/player/service.py similarity index 95% rename from fastanime/cli/service/player/service.py rename to viu/cli/service/player/service.py index 8b9e17a..ed153a9 100644 --- a/fastanime/cli/service/player/service.py +++ b/viu/cli/service/player/service.py @@ -2,7 +2,7 @@ import logging from typing import Optional from ....core.config import AppConfig -from ....core.exceptions import FastAnimeError +from ....core.exceptions import ViuError from ....libs.media_api.types import MediaItem from ....libs.player.base import BasePlayer from ....libs.player.params import PlayerParams @@ -64,4 +64,4 @@ class PlayerService: self.player, params, self.provider, anime, registry, media_item ) else: - raise FastAnimeError("Not implemented") + raise ViuError("Not implemented") diff --git a/fastanime/cli/service/registry/__init__.py b/viu/cli/service/registry/__init__.py similarity index 100% rename from fastanime/cli/service/registry/__init__.py rename to viu/cli/service/registry/__init__.py diff --git a/fastanime/cli/service/registry/models.py b/viu/cli/service/registry/models.py similarity index 100% rename from fastanime/cli/service/registry/models.py rename to viu/cli/service/registry/models.py diff --git a/fastanime/cli/service/registry/service.py b/viu/cli/service/registry/service.py similarity index 99% rename from fastanime/cli/service/registry/service.py rename to viu/cli/service/registry/service.py index f58dc99..7f0a411 100644 --- a/fastanime/cli/service/registry/service.py +++ b/viu/cli/service/registry/service.py @@ -5,7 +5,7 @@ from pathlib import Path from typing import Dict, Generator, List, Optional, TypedDict from ....core.config.model import MediaRegistryConfig -from ....core.exceptions import FastAnimeError +from ....core.exceptions import ViuError from ....core.utils.file import AtomicWriter, FileLock, check_file_modified from ....libs.media_api.params import MediaSearchParams from ....libs.media_api.types import ( @@ -69,7 +69,7 @@ class MediaRegistryService: # check if there was a major change in the registry if self._index.version[0] != REGISTRY_VERSION[0]: - raise FastAnimeError( + raise ViuError( f"Incompatible registry version of {self._index.version}. Current registry supports version {REGISTRY_VERSION}. Please migrate your registry using the migrator" ) diff --git a/fastanime/cli/service/session/__init__.py b/viu/cli/service/session/__init__.py similarity index 100% rename from fastanime/cli/service/session/__init__.py rename to viu/cli/service/session/__init__.py diff --git a/fastanime/cli/service/session/model.py b/viu/cli/service/session/model.py similarity index 100% rename from fastanime/cli/service/session/model.py rename to viu/cli/service/session/model.py diff --git a/fastanime/cli/service/session/service.py b/viu/cli/service/session/service.py similarity index 100% rename from fastanime/cli/service/session/service.py rename to viu/cli/service/session/service.py diff --git a/fastanime/cli/service/watch_history/__init__.py b/viu/cli/service/watch_history/__init__.py similarity index 100% rename from fastanime/cli/service/watch_history/__init__.py rename to viu/cli/service/watch_history/__init__.py diff --git a/fastanime/cli/service/watch_history/service.py b/viu/cli/service/watch_history/service.py similarity index 100% rename from fastanime/cli/service/watch_history/service.py rename to viu/cli/service/watch_history/service.py diff --git a/fastanime/cli/service/worker/service.py b/viu/cli/service/worker/service.py similarity index 96% rename from fastanime/cli/service/worker/service.py rename to viu/cli/service/worker/service.py index dc39c26..744e4ab 100644 --- a/fastanime/cli/service/worker/service.py +++ b/viu/cli/service/worker/service.py @@ -4,9 +4,9 @@ import threading import time from typing import Optional -from fastanime.cli.service.download.service import DownloadService -from fastanime.cli.service.notification.service import NotificationService -from fastanime.core.config.model import WorkerConfig +from viu.cli.service.download.service import DownloadService +from viu.cli.service.notification.service import NotificationService +from viu.core.config.model import WorkerConfig logger = logging.getLogger(__name__) diff --git a/fastanime/cli/utils/__init__.py b/viu/cli/utils/__init__.py similarity index 100% rename from fastanime/cli/utils/__init__.py rename to viu/cli/utils/__init__.py diff --git a/fastanime/cli/utils/ansi.py b/viu/cli/utils/ansi.py similarity index 100% rename from fastanime/cli/utils/ansi.py rename to viu/cli/utils/ansi.py diff --git a/fastanime/cli/utils/completion.py b/viu/cli/utils/completion.py similarity index 100% rename from fastanime/cli/utils/completion.py rename to viu/cli/utils/completion.py diff --git a/fastanime/cli/utils/exception.py b/viu/cli/utils/exception.py similarity index 100% rename from fastanime/cli/utils/exception.py rename to viu/cli/utils/exception.py diff --git a/fastanime/cli/utils/feh.py b/viu/cli/utils/feh.py similarity index 100% rename from fastanime/cli/utils/feh.py rename to viu/cli/utils/feh.py diff --git a/fastanime/cli/utils/icat.py b/viu/cli/utils/icat.py similarity index 100% rename from fastanime/cli/utils/icat.py rename to viu/cli/utils/icat.py diff --git a/fastanime/cli/utils/image.py b/viu/cli/utils/image.py similarity index 100% rename from fastanime/cli/utils/image.py rename to viu/cli/utils/image.py diff --git a/fastanime/cli/utils/lazyloader.py b/viu/cli/utils/lazyloader.py similarity index 100% rename from fastanime/cli/utils/lazyloader.py rename to viu/cli/utils/lazyloader.py diff --git a/fastanime/cli/utils/logging.py b/viu/cli/utils/logging.py similarity index 100% rename from fastanime/cli/utils/logging.py rename to viu/cli/utils/logging.py diff --git a/fastanime/cli/utils/parser.py b/viu/cli/utils/parser.py similarity index 98% rename from fastanime/cli/utils/parser.py rename to viu/cli/utils/parser.py index 8256316..73405fb 100644 --- a/fastanime/cli/utils/parser.py +++ b/viu/cli/utils/parser.py @@ -1,4 +1,4 @@ -"""Episode range parsing utilities for FastAnime CLI commands.""" +"""Episode range parsing utilities for Viu CLI commands.""" from typing import Iterator diff --git a/fastanime/cli/utils/preview.py b/viu/cli/utils/preview.py similarity index 100% rename from fastanime/cli/utils/preview.py rename to viu/cli/utils/preview.py diff --git a/fastanime/cli/utils/preview_workers.py b/viu/cli/utils/preview_workers.py similarity index 100% rename from fastanime/cli/utils/preview_workers.py rename to viu/cli/utils/preview_workers.py diff --git a/fastanime/cli/utils/update.py b/viu/cli/utils/update.py similarity index 97% rename from fastanime/cli/utils/update.py rename to viu/cli/utils/update.py index b1111bd..fc4b444 100644 --- a/fastanime/cli/utils/update.py +++ b/viu/cli/utils/update.py @@ -142,7 +142,7 @@ def update_app(force=False): process = subprocess.run(args, check=False) if process.returncode == 0: print( - "[green]Its recommended to run the following after updating:\n\tfastanime config --update (to get the latest config docs)\n\tfastanime cache --clean (to get rid of any potential issues)[/]", + "[green]Its recommended to run the following after updating:\n\tviu config --update (to get the latest config docs)\n\tviu cache --clean (to get rid of any potential issues)[/]", file=sys.stderr, ) return True, release_json diff --git a/fastanime/core/__init__.py b/viu/core/__init__.py similarity index 100% rename from fastanime/core/__init__.py rename to viu/core/__init__.py diff --git a/fastanime/core/config/__init__.py b/viu/core/config/__init__.py similarity index 100% rename from fastanime/core/config/__init__.py rename to viu/core/config/__init__.py diff --git a/fastanime/core/config/defaults.py b/viu/core/config/defaults.py similarity index 100% rename from fastanime/core/config/defaults.py rename to viu/core/config/defaults.py diff --git a/fastanime/core/config/descriptions.py b/viu/core/config/descriptions.py similarity index 98% rename from fastanime/core/config/descriptions.py rename to viu/core/config/descriptions.py index 35a7aca..405b78b 100644 --- a/fastanime/core/config/descriptions.py +++ b/viu/core/config/descriptions.py @@ -24,7 +24,7 @@ GENERAL_IMAGE_RENDERER = ( ) GENERAL_MANGA_VIEWER = "The external application to use for viewing manga pages." GENERAL_CHECK_FOR_UPDATES = ( - "Automatically check for new versions of FastAnime on startup." + "Automatically check for new versions of Viu on startup." ) GENERAL_CACHE_REQUESTS = ( "Enable caching of network requests to speed up subsequent operations." diff --git a/fastanime/core/config/model.py b/viu/core/config/model.py similarity index 99% rename from fastanime/core/config/model.py rename to viu/core/config/model.py index 8cf7348..ecab9ac 100644 --- a/fastanime/core/config/model.py +++ b/viu/core/config/model.py @@ -511,7 +511,7 @@ class MediaRegistryConfig(OtherConfig): class AppConfig(BaseModel): - """The root configuration model for the FastAnime application.""" + """The root configuration model for the Viu application.""" general: GeneralConfig = Field( default_factory=GeneralConfig, diff --git a/fastanime/core/constants.py b/viu/core/constants.py similarity index 95% rename from fastanime/core/constants.py rename to viu/core/constants.py index e620557..8edc2eb 100644 --- a/fastanime/core/constants.py +++ b/viu/core/constants.py @@ -4,8 +4,8 @@ from importlib import metadata, resources from pathlib import Path PLATFORM = sys.platform -PROJECT_NAME = "FASTANIME" -PROJECT_NAME_LOWER = "fastanime" +PROJECT_NAME = "VIU" +PROJECT_NAME_LOWER = "viu" APP_NAME = os.environ.get(f"{PROJECT_NAME}_APP_NAME", PROJECT_NAME.lower()) USER_NAME = os.environ.get("USERNAME", "User") @@ -15,7 +15,7 @@ __version__ = metadata.version(PROJECT_NAME) AUTHOR = "Benexl" GIT_REPO = "github.com" GIT_PROTOCOL = "https://" -REPO_HOME = f"https://{GIT_REPO}/{AUTHOR}/FastAnime" +REPO_HOME = f"https://{GIT_REPO}/{AUTHOR}/Viu" DISCORD_INVITE = "https://discord.gg/C4rhMA4mmK" diff --git a/fastanime/core/downloader/__init__.py b/viu/core/downloader/__init__.py similarity index 100% rename from fastanime/core/downloader/__init__.py rename to viu/core/downloader/__init__.py diff --git a/fastanime/core/downloader/base.py b/viu/core/downloader/base.py similarity index 100% rename from fastanime/core/downloader/base.py rename to viu/core/downloader/base.py diff --git a/fastanime/core/downloader/default.py b/viu/core/downloader/default.py similarity index 98% rename from fastanime/core/downloader/default.py rename to viu/core/downloader/default.py index f6d6594..9d74825 100644 --- a/fastanime/core/downloader/default.py +++ b/viu/core/downloader/default.py @@ -22,7 +22,7 @@ from rich.progress import ( from rich.prompt import Confirm from ..utils.file import sanitize_filename -from ..exceptions import FastAnimeError +from ..exceptions import ViuError from ..patterns import TORRENT_REGEX from ..utils.networking import get_remote_filename from .base import BaseDownloader @@ -283,7 +283,7 @@ class DefaultDownloader(BaseDownloader): hook(error_info) except Exception as hook_error: logger.warning(f"Progress hook failed: {hook_error}") - raise FastAnimeError(f"Failed to download video: {e}") + raise ViuError(f"Failed to download video: {e}") def _download_subs(self, params: DownloadParams) -> list[Path]: """Download subtitles from provided URLs.""" @@ -327,7 +327,7 @@ class DefaultDownloader(BaseDownloader): """Merge subtitles with video using ffmpeg and return the path to the merged file.""" ffmpeg_executable = shutil.which("ffmpeg") if not ffmpeg_executable: - raise FastAnimeError("Please install ffmpeg in order to merge subtitles") + raise ViuError("Please install ffmpeg in order to merge subtitles") merged_filename = video_path.stem + ".mkv" diff --git a/fastanime/core/downloader/downloader.py b/viu/core/downloader/downloader.py similarity index 90% rename from fastanime/core/downloader/downloader.py rename to viu/core/downloader/downloader.py index c9220e6..bb2b6b6 100644 --- a/fastanime/core/downloader/downloader.py +++ b/viu/core/downloader/downloader.py @@ -1,5 +1,5 @@ from ..config.model import DownloadsConfig -from ..exceptions import FastAnimeError +from ..exceptions import ViuError from .base import BaseDownloader DOWNLOADERS = ["auto", "default", "yt-dlp"] @@ -13,7 +13,7 @@ class DownloadFactory: """ downloader_name = config.downloader if downloader_name not in DOWNLOADERS: - raise FastAnimeError( + raise ViuError( f"Unsupported selector: '{downloader_name}'.Available selectors are: {DOWNLOADERS}" ) @@ -36,7 +36,7 @@ class DownloadFactory: return DefaultDownloader(config) else: - raise FastAnimeError("Downloader not implemented") + raise ViuError("Downloader not implemented") # Simple alias for ease of use diff --git a/fastanime/core/downloader/model.py b/viu/core/downloader/model.py similarity index 100% rename from fastanime/core/downloader/model.py rename to viu/core/downloader/model.py diff --git a/fastanime/core/downloader/params.py b/viu/core/downloader/params.py similarity index 100% rename from fastanime/core/downloader/params.py rename to viu/core/downloader/params.py diff --git a/fastanime/core/downloader/torrents.py b/viu/core/downloader/torrents.py similarity index 98% rename from fastanime/core/downloader/torrents.py rename to viu/core/downloader/torrents.py index 00ce006..9b81ed9 100644 --- a/fastanime/core/downloader/torrents.py +++ b/viu/core/downloader/torrents.py @@ -6,7 +6,7 @@ import time from pathlib import Path from typing import Optional, Dict, Any, Callable -from ..exceptions import FastAnimeError, DependencyNotFoundError +from ..exceptions import ViuError, DependencyNotFoundError try: import libtorrent as lt @@ -19,7 +19,7 @@ except ImportError: logger = logging.getLogger(__name__) -class TorrentDownloadError(FastAnimeError): +class TorrentDownloadError(ViuError): """Raised when torrent download fails.""" pass @@ -69,7 +69,7 @@ class TorrentDownloader: # Configure session settings settings = { - "user_agent": "FastAnime/1.0", + "user_agent": "Viu/1.0", "listen_interfaces": f"0.0.0.0:{self.listen_port}", "enable_outgoing_utp": True, "enable_incoming_utp": True, diff --git a/fastanime/core/downloader/yt_dlp.py b/viu/core/downloader/yt_dlp.py similarity index 98% rename from fastanime/core/downloader/yt_dlp.py rename to viu/core/downloader/yt_dlp.py index a275939..4dd2acf 100644 --- a/fastanime/core/downloader/yt_dlp.py +++ b/viu/core/downloader/yt_dlp.py @@ -12,7 +12,7 @@ from rich.prompt import Confirm import yt_dlp from yt_dlp.utils import sanitize_filename -from ..exceptions import FastAnimeError +from ..exceptions import ViuError from ..patterns import TORRENT_REGEX from ..utils.networking import get_remote_filename from .base import BaseDownloader @@ -156,7 +156,7 @@ class YtDLPDownloader(BaseDownloader): try: response.raise_for_status() except httpx.HTTPError: - raise FastAnimeError("Failed to download sub: {e}") + raise ViuError("Failed to download sub: {e}") filename = get_remote_filename(response) if not filename: @@ -177,7 +177,7 @@ class YtDLPDownloader(BaseDownloader): """Merge subtitles with video and return the path to the merged file.""" self.FFMPEG_EXECUTABLE = shutil.which("ffmpeg") if not self.FFMPEG_EXECUTABLE: - raise FastAnimeError("Please install ffmpeg in order to merge subs") + raise ViuError("Please install ffmpeg in order to merge subs") merged_filename = video_path.stem + ".mkv" subs_input_args = list( diff --git a/fastanime/core/exceptions.py b/viu/core/exceptions.py similarity index 90% rename from fastanime/core/exceptions.py rename to viu/core/exceptions.py index 7170220..4a014b7 100644 --- a/fastanime/core/exceptions.py +++ b/viu/core/exceptions.py @@ -1,6 +1,6 @@ -class FastAnimeError(Exception): +class ViuError(Exception): """ - Base exception for all custom errors raised by the FastAnime library and application. + Base exception for all custom errors raised by the Viu library and application. Catching this exception will catch any error originating from within this project, distinguishing it from built-in Python errors or third-party library errors. @@ -14,7 +14,7 @@ class FastAnimeError(Exception): # ============================================================================== -class ConfigError(FastAnimeError): +class ConfigError(ViuError): """ Represents an error found in the user's configuration file (config.ini). @@ -24,7 +24,7 @@ class ConfigError(FastAnimeError): pass -class DependencyNotFoundError(FastAnimeError): +class DependencyNotFoundError(ViuError): """ A required external command-line tool (e.g., ffmpeg, fzf) was not found. @@ -46,7 +46,7 @@ class DependencyNotFoundError(FastAnimeError): # ============================================================================== -class ProviderError(FastAnimeError): +class ProviderError(ViuError): """ Base class for all errors related to an anime provider. @@ -95,7 +95,7 @@ class ProviderParsingError(ProviderError): # ============================================================================== -class DownloaderError(FastAnimeError): +class DownloaderError(ViuError): """ An error occurred during the file download or post-processing phase. @@ -106,12 +106,12 @@ class DownloaderError(FastAnimeError): pass -class InvalidEpisodeRangeError(FastAnimeError, ValueError): +class InvalidEpisodeRangeError(ViuError, ValueError): """ The user-provided episode range string is malformed or invalid. Inherits from ValueError for semantic compatibility but allows for specific - catching as a FastAnimeError. + catching as a ViuError. """ pass diff --git a/fastanime/core/patterns.py b/viu/core/patterns.py similarity index 100% rename from fastanime/core/patterns.py rename to viu/core/patterns.py diff --git a/viu/core/utils/__init__.py b/viu/core/utils/__init__.py new file mode 100644 index 0000000..b06c8eb --- /dev/null +++ b/viu/core/utils/__init__.py @@ -0,0 +1,7 @@ +""" +Core utilities for Viu application. + +This module provides various utility classes and functions used throughout +the Viu application, including concurrency management, file operations, +and other common functionality. +""" diff --git a/fastanime/core/utils/concurrency.py b/viu/core/utils/concurrency.py similarity index 100% rename from fastanime/core/utils/concurrency.py rename to viu/core/utils/concurrency.py diff --git a/fastanime/core/utils/converter.py b/viu/core/utils/converter.py similarity index 100% rename from fastanime/core/utils/converter.py rename to viu/core/utils/converter.py diff --git a/fastanime/core/utils/detect.py b/viu/core/utils/detect.py similarity index 100% rename from fastanime/core/utils/detect.py rename to viu/core/utils/detect.py diff --git a/fastanime/core/utils/file.py b/viu/core/utils/file.py similarity index 100% rename from fastanime/core/utils/file.py rename to viu/core/utils/file.py diff --git a/fastanime/core/utils/formatter.py b/viu/core/utils/formatter.py similarity index 100% rename from fastanime/core/utils/formatter.py rename to viu/core/utils/formatter.py diff --git a/fastanime/core/utils/fuzzy.py b/viu/core/utils/fuzzy.py similarity index 98% rename from fastanime/core/utils/fuzzy.py rename to viu/core/utils/fuzzy.py index 4a601d9..0fdcb80 100644 --- a/fastanime/core/utils/fuzzy.py +++ b/viu/core/utils/fuzzy.py @@ -7,7 +7,7 @@ otherwise falls back to a pure Python implementation with the same API. Usage: Basic usage with the convenience functions: - >>> from fastanime.core.utils.fuzzy import fuzz + >>> from viu.core.utils.fuzzy import fuzz >>> fuzz.ratio("hello world", "hello") 62 >>> fuzz.partial_ratio("hello world", "hello") @@ -15,7 +15,7 @@ Usage: Using the FuzzyMatcher class directly: - >>> from fastanime.core.utils.fuzzy import FuzzyMatcher + >>> from viu.core.utils.fuzzy import FuzzyMatcher >>> matcher = FuzzyMatcher() >>> matcher.backend 'thefuzz' # or 'pure_python' if thefuzz is not available @@ -24,7 +24,7 @@ Usage: For drop-in replacement of thefuzz.fuzz: - >>> from fastanime.core.utils.fuzzy import ratio, partial_ratio + >>> from viu.core.utils.fuzzy import ratio, partial_ratio >>> ratio("test", "best") 75 """ diff --git a/fastanime/core/utils/graphql.py b/viu/core/utils/graphql.py similarity index 100% rename from fastanime/core/utils/graphql.py rename to viu/core/utils/graphql.py diff --git a/fastanime/core/utils/networking.py b/viu/core/utils/networking.py similarity index 100% rename from fastanime/core/utils/networking.py rename to viu/core/utils/networking.py diff --git a/fastanime/core/utils/normalizer.py b/viu/core/utils/normalizer.py similarity index 100% rename from fastanime/core/utils/normalizer.py rename to viu/core/utils/normalizer.py diff --git a/fastanime/libs/__init__.py b/viu/libs/__init__.py similarity index 100% rename from fastanime/libs/__init__.py rename to viu/libs/__init__.py diff --git a/fastanime/libs/aniskip/__init__.py b/viu/libs/aniskip/__init__.py similarity index 100% rename from fastanime/libs/aniskip/__init__.py rename to viu/libs/aniskip/__init__.py diff --git a/fastanime/libs/aniskip/api.py b/viu/libs/aniskip/api.py similarity index 100% rename from fastanime/libs/aniskip/api.py rename to viu/libs/aniskip/api.py diff --git a/fastanime/libs/discord/__init__.py b/viu/libs/discord/__init__.py similarity index 100% rename from fastanime/libs/discord/__init__.py rename to viu/libs/discord/__init__.py diff --git a/fastanime/libs/discord/api.py b/viu/libs/discord/api.py similarity index 100% rename from fastanime/libs/discord/api.py rename to viu/libs/discord/api.py diff --git a/fastanime/libs/media_api/__init__.py b/viu/libs/media_api/__init__.py similarity index 100% rename from fastanime/libs/media_api/__init__.py rename to viu/libs/media_api/__init__.py diff --git a/fastanime/libs/media_api/anilist/__init__.py b/viu/libs/media_api/anilist/__init__.py similarity index 100% rename from fastanime/libs/media_api/anilist/__init__.py rename to viu/libs/media_api/anilist/__init__.py diff --git a/fastanime/libs/media_api/anilist/api.py b/viu/libs/media_api/anilist/api.py similarity index 100% rename from fastanime/libs/media_api/anilist/api.py rename to viu/libs/media_api/anilist/api.py diff --git a/fastanime/libs/media_api/anilist/gql.py b/viu/libs/media_api/anilist/gql.py similarity index 100% rename from fastanime/libs/media_api/anilist/gql.py rename to viu/libs/media_api/anilist/gql.py diff --git a/fastanime/libs/media_api/anilist/mapper.py b/viu/libs/media_api/anilist/mapper.py similarity index 100% rename from fastanime/libs/media_api/anilist/mapper.py rename to viu/libs/media_api/anilist/mapper.py diff --git a/fastanime/libs/media_api/anilist/types.py b/viu/libs/media_api/anilist/types.py similarity index 100% rename from fastanime/libs/media_api/anilist/types.py rename to viu/libs/media_api/anilist/types.py diff --git a/fastanime/libs/media_api/api.py b/viu/libs/media_api/api.py similarity index 89% rename from fastanime/libs/media_api/api.py rename to viu/libs/media_api/api.py index 8b03249..b9c0a22 100644 --- a/fastanime/libs/media_api/api.py +++ b/viu/libs/media_api/api.py @@ -16,8 +16,8 @@ logger = logging.getLogger(__name__) # Map the client name to its import path AND the config section it needs. API_CLIENTS = { - "anilist": ("fastanime.libs.media_api.anilist.api.AniListApi", "anilist"), - "jikan": ("fastanime.libs.media_api.jikan.api.JikanApi", "jikan"), # For the future + "anilist": ("viu.libs.media_api.anilist.api.AniListApi", "anilist"), + "jikan": ("viu.libs.media_api.jikan.api.JikanApi", "jikan"), # For the future } diff --git a/fastanime/libs/media_api/base.py b/viu/libs/media_api/base.py similarity index 100% rename from fastanime/libs/media_api/base.py rename to viu/libs/media_api/base.py diff --git a/fastanime/libs/media_api/jikan/__init__.py b/viu/libs/media_api/jikan/__init__.py similarity index 100% rename from fastanime/libs/media_api/jikan/__init__.py rename to viu/libs/media_api/jikan/__init__.py diff --git a/fastanime/libs/media_api/jikan/api.py b/viu/libs/media_api/jikan/api.py similarity index 100% rename from fastanime/libs/media_api/jikan/api.py rename to viu/libs/media_api/jikan/api.py diff --git a/fastanime/libs/media_api/jikan/mapper.py b/viu/libs/media_api/jikan/mapper.py similarity index 100% rename from fastanime/libs/media_api/jikan/mapper.py rename to viu/libs/media_api/jikan/mapper.py diff --git a/fastanime/libs/media_api/params.py b/viu/libs/media_api/params.py similarity index 100% rename from fastanime/libs/media_api/params.py rename to viu/libs/media_api/params.py diff --git a/fastanime/libs/media_api/types.py b/viu/libs/media_api/types.py similarity index 100% rename from fastanime/libs/media_api/types.py rename to viu/libs/media_api/types.py diff --git a/fastanime/libs/media_api/utils/debug.py b/viu/libs/media_api/utils/debug.py similarity index 99% rename from fastanime/libs/media_api/utils/debug.py rename to viu/libs/media_api/utils/debug.py index 73dd81a..57fe909 100644 --- a/fastanime/libs/media_api/utils/debug.py +++ b/viu/libs/media_api/utils/debug.py @@ -25,7 +25,7 @@ def test_media_api(api_client: BaseApiClient): api_client: An instance of AniListApi to test Usage: - Run this module directly: python -m fastanime.libs.media_api.anilist.api + Run this module directly: python -m viu.libs.media_api.anilist.api Or import and call: test_media_api(AniListApi(config, client)) """ from ....core.constants import APP_ASCII_ART diff --git a/fastanime/libs/player/__init__.py b/viu/libs/player/__init__.py similarity index 88% rename from fastanime/libs/player/__init__.py rename to viu/libs/player/__init__.py index fd5b71f..23584a4 100644 --- a/fastanime/libs/player/__init__.py +++ b/viu/libs/player/__init__.py @@ -1,5 +1,5 @@ """ -The player package provides abstractions and implementations for media player integration in FastAnime. +The player package provides abstractions and implementations for media player integration in Viu. This package defines the base player interface, player parameter/result types, and concrete implementations for various media players (e.g., MPV, VLC, Syncplay). """ diff --git a/fastanime/libs/player/base.py b/viu/libs/player/base.py similarity index 99% rename from fastanime/libs/player/base.py rename to viu/libs/player/base.py index 1665e1c..8a45911 100644 --- a/fastanime/libs/player/base.py +++ b/viu/libs/player/base.py @@ -1,5 +1,5 @@ """ -Defines the abstract base class for all media player integrations in FastAnime. +Defines the abstract base class for all media player integrations in Viu. All concrete player implementations must inherit from BasePlayer and implement its methods. """ diff --git a/fastanime/libs/player/mpv/__init__.py b/viu/libs/player/mpv/__init__.py similarity index 100% rename from fastanime/libs/player/mpv/__init__.py rename to viu/libs/player/mpv/__init__.py diff --git a/fastanime/libs/player/mpv/player.py b/viu/libs/player/mpv/player.py similarity index 95% rename from fastanime/libs/player/mpv/player.py rename to viu/libs/player/mpv/player.py index 2d210b8..83bf8cf 100644 --- a/fastanime/libs/player/mpv/player.py +++ b/viu/libs/player/mpv/player.py @@ -1,5 +1,5 @@ """ -MPV player integration for FastAnime. +MPV player integration for Viu. This module provides the MpvPlayer class, which implements the BasePlayer interface for the MPV media player. """ @@ -10,7 +10,7 @@ import shutil import subprocess from ....core.config import MpvConfig -from ....core.exceptions import FastAnimeError +from ....core.exceptions import ViuError from ....core.patterns import TORRENT_REGEX, YOUTUBE_REGEX from ....core.utils import detect from ..base import BasePlayer @@ -24,7 +24,7 @@ MPV_AV_TIME_PATTERN = re.compile(r"AV: ([0-9:]*) / ([0-9:]*) \(([0-9]*)%\)") class MpvPlayer(BasePlayer): """ - MPV player implementation for FastAnime. + MPV player implementation for Viu. Provides playback functionality using the MPV media player, supporting desktop, mobile, torrents, and syncplay. """ @@ -50,9 +50,9 @@ class MpvPlayer(BasePlayer): PlayerResult: Information about the playback session. """ if TORRENT_REGEX.match(params.url) and detect.is_running_in_termux(): - raise FastAnimeError("Unable to play torrents on termux") + raise ViuError("Unable to play torrents on termux") elif params.syncplay and detect.is_running_in_termux(): - raise FastAnimeError("Unable to play torrents on termux") + raise ViuError("Unable to play torrents on termux") elif detect.is_running_in_termux(): return self._play_on_mobile(params) else: @@ -112,7 +112,7 @@ class MpvPlayer(BasePlayer): PlayerResult: Information about the playback session. """ if not self.executable: - raise FastAnimeError("MPV executable not found in PATH.") + raise ViuError("MPV executable not found in PATH.") if TORRENT_REGEX.search(params.url): return self._stream_on_desktop_with_webtorrent_cli(params) @@ -203,7 +203,7 @@ class MpvPlayer(BasePlayer): """ WEBTORRENT_CLI = shutil.which("webtorrent") if not WEBTORRENT_CLI: - raise FastAnimeError( + raise ViuError( "Please Install webtorrent cli inorder to stream torrents" ) @@ -227,7 +227,7 @@ class MpvPlayer(BasePlayer): """ SYNCPLAY_EXECUTABLE = shutil.which("syncplay") if not SYNCPLAY_EXECUTABLE: - raise FastAnimeError( + raise ViuError( "Please install syncplay to be able to stream with your friends" ) args = [SYNCPLAY_EXECUTABLE, params.url] diff --git a/fastanime/libs/player/params.py b/viu/libs/player/params.py similarity index 100% rename from fastanime/libs/player/params.py rename to viu/libs/player/params.py diff --git a/fastanime/libs/player/player.py b/viu/libs/player/player.py similarity index 95% rename from fastanime/libs/player/player.py rename to viu/libs/player/player.py index 4a1391e..247b27b 100644 --- a/fastanime/libs/player/player.py +++ b/viu/libs/player/player.py @@ -1,5 +1,5 @@ """ -Player factory and registration logic for FastAnime media players. +Player factory and registration logic for Viu media players. This module provides a factory for instantiating the correct player implementation based on configuration. """ diff --git a/fastanime/libs/player/syncplay/__init__.py b/viu/libs/player/syncplay/__init__.py similarity index 100% rename from fastanime/libs/player/syncplay/__init__.py rename to viu/libs/player/syncplay/__init__.py diff --git a/fastanime/libs/player/syncplay/player.py b/viu/libs/player/syncplay/player.py similarity index 97% rename from fastanime/libs/player/syncplay/player.py rename to viu/libs/player/syncplay/player.py index 0f38bc1..bdc0f7c 100644 --- a/fastanime/libs/player/syncplay/player.py +++ b/viu/libs/player/syncplay/player.py @@ -1,5 +1,5 @@ """ -Syncplay integration for FastAnime. +Syncplay integration for Viu. This module provides a procedural function to launch Syncplay with the given media and options. """ diff --git a/fastanime/libs/player/types.py b/viu/libs/player/types.py similarity index 100% rename from fastanime/libs/player/types.py rename to viu/libs/player/types.py diff --git a/fastanime/libs/player/vlc/__init__.py b/viu/libs/player/vlc/__init__.py similarity index 100% rename from fastanime/libs/player/vlc/__init__.py rename to viu/libs/player/vlc/__init__.py diff --git a/fastanime/libs/player/vlc/player.py b/viu/libs/player/vlc/player.py similarity index 95% rename from fastanime/libs/player/vlc/player.py rename to viu/libs/player/vlc/player.py index 6e295d1..a0b4fe4 100644 --- a/fastanime/libs/player/vlc/player.py +++ b/viu/libs/player/vlc/player.py @@ -1,5 +1,5 @@ """ -VLC player integration for FastAnime. +VLC player integration for Viu. This module provides the VlcPlayer class, which implements the BasePlayer interface for the VLC media player. """ @@ -9,7 +9,7 @@ import shutil import subprocess from ....core.config import VlcConfig -from ....core.exceptions import FastAnimeError +from ....core.exceptions import ViuError from ....core.patterns import TORRENT_REGEX, YOUTUBE_REGEX from ....core.utils import detect from ..base import BasePlayer @@ -21,7 +21,7 @@ logger = logging.getLogger(__name__) class VlcPlayer(BasePlayer): """ - VLC player implementation for FastAnime. + VLC player implementation for Viu. Provides playback functionality using the VLC media player, supporting desktop, mobile, and torrent scenarios. """ @@ -47,7 +47,7 @@ class VlcPlayer(BasePlayer): PlayerResult: Information about the playback session. """ if not self.executable: - raise FastAnimeError("VLC executable not found in PATH.") + raise ViuError("VLC executable not found in PATH.") if TORRENT_REGEX.match(params.url) and detect.is_running_in_termux(): return self._play_on_mobile(params) @@ -147,7 +147,7 @@ class VlcPlayer(BasePlayer): """ WEBTORRENT_CLI = shutil.which("webtorrent") if not WEBTORRENT_CLI: - raise FastAnimeError( + raise ViuError( "Please Install webtorrent cli inorder to stream torrents" ) diff --git a/fastanime/libs/provider/__init__.py b/viu/libs/provider/__init__.py similarity index 100% rename from fastanime/libs/provider/__init__.py rename to viu/libs/provider/__init__.py diff --git a/fastanime/libs/provider/anime/__init__.py b/viu/libs/provider/anime/__init__.py similarity index 100% rename from fastanime/libs/provider/anime/__init__.py rename to viu/libs/provider/anime/__init__.py diff --git a/fastanime/libs/provider/anime/allanime/__init__.py b/viu/libs/provider/anime/allanime/__init__.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/__init__.py rename to viu/libs/provider/anime/allanime/__init__.py diff --git a/fastanime/libs/provider/anime/allanime/constants.py b/viu/libs/provider/anime/allanime/constants.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/constants.py rename to viu/libs/provider/anime/allanime/constants.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/__init__.py b/viu/libs/provider/anime/allanime/extractors/__init__.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/__init__.py rename to viu/libs/provider/anime/allanime/extractors/__init__.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/ak.py b/viu/libs/provider/anime/allanime/extractors/ak.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/ak.py rename to viu/libs/provider/anime/allanime/extractors/ak.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/base.py b/viu/libs/provider/anime/allanime/extractors/base.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/base.py rename to viu/libs/provider/anime/allanime/extractors/base.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/dropbox.py b/viu/libs/provider/anime/allanime/extractors/dropbox.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/dropbox.py rename to viu/libs/provider/anime/allanime/extractors/dropbox.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/extractor.py b/viu/libs/provider/anime/allanime/extractors/extractor.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/extractor.py rename to viu/libs/provider/anime/allanime/extractors/extractor.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/filemoon.py b/viu/libs/provider/anime/allanime/extractors/filemoon.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/filemoon.py rename to viu/libs/provider/anime/allanime/extractors/filemoon.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/gogoanime.py b/viu/libs/provider/anime/allanime/extractors/gogoanime.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/gogoanime.py rename to viu/libs/provider/anime/allanime/extractors/gogoanime.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/mp4_upload.py b/viu/libs/provider/anime/allanime/extractors/mp4_upload.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/mp4_upload.py rename to viu/libs/provider/anime/allanime/extractors/mp4_upload.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/sharepoint.py b/viu/libs/provider/anime/allanime/extractors/sharepoint.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/sharepoint.py rename to viu/libs/provider/anime/allanime/extractors/sharepoint.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/streamsb.py b/viu/libs/provider/anime/allanime/extractors/streamsb.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/streamsb.py rename to viu/libs/provider/anime/allanime/extractors/streamsb.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/vid_mp4.py b/viu/libs/provider/anime/allanime/extractors/vid_mp4.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/vid_mp4.py rename to viu/libs/provider/anime/allanime/extractors/vid_mp4.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/we_transfer.py b/viu/libs/provider/anime/allanime/extractors/we_transfer.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/we_transfer.py rename to viu/libs/provider/anime/allanime/extractors/we_transfer.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/wixmp.py b/viu/libs/provider/anime/allanime/extractors/wixmp.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/wixmp.py rename to viu/libs/provider/anime/allanime/extractors/wixmp.py diff --git a/fastanime/libs/provider/anime/allanime/extractors/yt_mp4.py b/viu/libs/provider/anime/allanime/extractors/yt_mp4.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/extractors/yt_mp4.py rename to viu/libs/provider/anime/allanime/extractors/yt_mp4.py diff --git a/fastanime/libs/provider/anime/allanime/mappers.py b/viu/libs/provider/anime/allanime/mappers.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/mappers.py rename to viu/libs/provider/anime/allanime/mappers.py diff --git a/fastanime/libs/provider/anime/allanime/provider.py b/viu/libs/provider/anime/allanime/provider.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/provider.py rename to viu/libs/provider/anime/allanime/provider.py diff --git a/fastanime/libs/provider/anime/allanime/types.py b/viu/libs/provider/anime/allanime/types.py similarity index 100% rename from fastanime/libs/provider/anime/allanime/types.py rename to viu/libs/provider/anime/allanime/types.py diff --git a/fastanime/libs/provider/anime/allanime/utils.py b/viu/libs/provider/anime/allanime/utils.py similarity index 97% rename from fastanime/libs/provider/anime/allanime/utils.py rename to viu/libs/provider/anime/allanime/utils.py index 857b6f2..49687a9 100644 --- a/fastanime/libs/provider/anime/allanime/utils.py +++ b/viu/libs/provider/anime/allanime/utils.py @@ -43,7 +43,7 @@ hex_to_char = { def debug_extractor(extractor_function): @functools.wraps(extractor_function) def _provider_function_wrapper(*args): - if not os.environ.get("FASTANIME_DEBUG"): + if not os.environ.get("VIU_DEBUG"): try: return extractor_function(*args) except Exception as e: diff --git a/fastanime/libs/provider/anime/animepahe/__init__.py b/viu/libs/provider/anime/animepahe/__init__.py similarity index 100% rename from fastanime/libs/provider/anime/animepahe/__init__.py rename to viu/libs/provider/anime/animepahe/__init__.py diff --git a/fastanime/libs/provider/anime/animepahe/constants.py b/viu/libs/provider/anime/animepahe/constants.py similarity index 100% rename from fastanime/libs/provider/anime/animepahe/constants.py rename to viu/libs/provider/anime/animepahe/constants.py diff --git a/fastanime/libs/provider/anime/animepahe/extractor.py b/viu/libs/provider/anime/animepahe/extractor.py similarity index 100% rename from fastanime/libs/provider/anime/animepahe/extractor.py rename to viu/libs/provider/anime/animepahe/extractor.py diff --git a/fastanime/libs/provider/anime/animepahe/mappers.py b/viu/libs/provider/anime/animepahe/mappers.py similarity index 100% rename from fastanime/libs/provider/anime/animepahe/mappers.py rename to viu/libs/provider/anime/animepahe/mappers.py diff --git a/fastanime/libs/provider/anime/animepahe/provider.py b/viu/libs/provider/anime/animepahe/provider.py similarity index 100% rename from fastanime/libs/provider/anime/animepahe/provider.py rename to viu/libs/provider/anime/animepahe/provider.py diff --git a/fastanime/libs/provider/anime/animepahe/types.py b/viu/libs/provider/anime/animepahe/types.py similarity index 100% rename from fastanime/libs/provider/anime/animepahe/types.py rename to viu/libs/provider/anime/animepahe/types.py diff --git a/fastanime/libs/provider/anime/base.py b/viu/libs/provider/anime/base.py similarity index 100% rename from fastanime/libs/provider/anime/base.py rename to viu/libs/provider/anime/base.py diff --git a/fastanime/libs/provider/anime/params.py b/viu/libs/provider/anime/params.py similarity index 100% rename from fastanime/libs/provider/anime/params.py rename to viu/libs/provider/anime/params.py diff --git a/fastanime/libs/provider/anime/provider.py b/viu/libs/provider/anime/provider.py similarity index 96% rename from fastanime/libs/provider/anime/provider.py rename to viu/libs/provider/anime/provider.py index a26cee7..492355e 100644 --- a/fastanime/libs/provider/anime/provider.py +++ b/viu/libs/provider/anime/provider.py @@ -45,7 +45,7 @@ class AnimeProviderFactory: module_name, class_name = import_path.split(".", 1) # Construct the full package path for dynamic import - package_path = f"fastanime.libs.provider.anime.{provider_name.value.lower()}" + package_path = f"viu.libs.provider.anime.{provider_name.value.lower()}" try: provider_module = importlib.import_module(f".{module_name}", package_path) diff --git a/fastanime/libs/provider/anime/types.py b/viu/libs/provider/anime/types.py similarity index 100% rename from fastanime/libs/provider/anime/types.py rename to viu/libs/provider/anime/types.py diff --git a/fastanime/libs/provider/anime/utils/debug.py b/viu/libs/provider/anime/utils/debug.py similarity index 98% rename from fastanime/libs/provider/anime/utils/debug.py rename to viu/libs/provider/anime/utils/debug.py index a8d00b8..f288487 100644 --- a/fastanime/libs/provider/anime/utils/debug.py +++ b/viu/libs/provider/anime/utils/debug.py @@ -12,7 +12,7 @@ def debug_provider(provider_function): @functools.wraps(provider_function) def _provider_function_wrapper(self, *args, **kwargs): provider_name = self.__class__.__name__.upper() - if not os.environ.get("FASTANIME_DEBUG"): + if not os.environ.get("VIU_DEBUG"): try: return provider_function(self, *args, **kwargs) except Exception as e: diff --git a/fastanime/libs/provider/manga/MangaProvider.py b/viu/libs/provider/manga/MangaProvider.py similarity index 97% rename from fastanime/libs/provider/manga/MangaProvider.py rename to viu/libs/provider/manga/MangaProvider.py index 0ff8c9a..91cbe4d 100644 --- a/fastanime/libs/provider/manga/MangaProvider.py +++ b/viu/libs/provider/manga/MangaProvider.py @@ -39,7 +39,7 @@ class MangaProvider: def lazyload_provider(self, provider): """updates the current provider being used""" _, anime_provider_cls_name = manga_sources[provider].split(".", 1) - package = f"fastanime.libs.manga_provider.{provider}" + package = f"viu.libs.manga_provider.{provider}" provider_api = importlib.import_module(".api", package) manga_provider = getattr(provider_api, anime_provider_cls_name) self.manga_provider = manga_provider() diff --git a/fastanime/libs/provider/manga/__init__.py b/viu/libs/provider/manga/__init__.py similarity index 100% rename from fastanime/libs/provider/manga/__init__.py rename to viu/libs/provider/manga/__init__.py diff --git a/fastanime/libs/provider/manga/base.py b/viu/libs/provider/manga/base.py similarity index 100% rename from fastanime/libs/provider/manga/base.py rename to viu/libs/provider/manga/base.py diff --git a/fastanime/libs/provider/manga/common.py b/viu/libs/provider/manga/common.py similarity index 100% rename from fastanime/libs/provider/manga/common.py rename to viu/libs/provider/manga/common.py diff --git a/fastanime/libs/provider/manga/mangadex/__init__.py b/viu/libs/provider/manga/mangadex/__init__.py similarity index 100% rename from fastanime/libs/provider/manga/mangadex/__init__.py rename to viu/libs/provider/manga/mangadex/__init__.py diff --git a/fastanime/libs/provider/manga/mangadex/api.py b/viu/libs/provider/manga/mangadex/api.py similarity index 100% rename from fastanime/libs/provider/manga/mangadex/api.py rename to viu/libs/provider/manga/mangadex/api.py diff --git a/fastanime/libs/provider/scraping/__init__.py b/viu/libs/provider/scraping/__init__.py similarity index 100% rename from fastanime/libs/provider/scraping/__init__.py rename to viu/libs/provider/scraping/__init__.py diff --git a/fastanime/libs/provider/scraping/html_parser.py b/viu/libs/provider/scraping/html_parser.py similarity index 100% rename from fastanime/libs/provider/scraping/html_parser.py rename to viu/libs/provider/scraping/html_parser.py diff --git a/fastanime/libs/provider/scraping/user_agents.py b/viu/libs/provider/scraping/user_agents.py similarity index 100% rename from fastanime/libs/provider/scraping/user_agents.py rename to viu/libs/provider/scraping/user_agents.py diff --git a/fastanime/libs/provider/scraping/utils.py b/viu/libs/provider/scraping/utils.py similarity index 100% rename from fastanime/libs/provider/scraping/utils.py rename to viu/libs/provider/scraping/utils.py diff --git a/fastanime/libs/selectors/__init__.py b/viu/libs/selectors/__init__.py similarity index 100% rename from fastanime/libs/selectors/__init__.py rename to viu/libs/selectors/__init__.py diff --git a/fastanime/libs/selectors/base.py b/viu/libs/selectors/base.py similarity index 100% rename from fastanime/libs/selectors/base.py rename to viu/libs/selectors/base.py diff --git a/fastanime/libs/selectors/fzf/__init__.py b/viu/libs/selectors/fzf/__init__.py similarity index 100% rename from fastanime/libs/selectors/fzf/__init__.py rename to viu/libs/selectors/fzf/__init__.py diff --git a/fastanime/libs/selectors/fzf/selector.py b/viu/libs/selectors/fzf/selector.py similarity index 97% rename from fastanime/libs/selectors/fzf/selector.py rename to viu/libs/selectors/fzf/selector.py index 17fc060..cf4e5dd 100644 --- a/fastanime/libs/selectors/fzf/selector.py +++ b/viu/libs/selectors/fzf/selector.py @@ -6,7 +6,7 @@ import subprocess from rich.prompt import Prompt from ....core.config import FzfConfig -from ....core.exceptions import FastAnimeError +from ....core.exceptions import ViuError from ..base import BaseSelector logger = logging.getLogger(__name__) @@ -17,7 +17,7 @@ class FzfSelector(BaseSelector): self.config = config self.executable = shutil.which("fzf") if not self.executable: - raise FastAnimeError("Please install fzf to use the fzf selector") + raise ViuError("Please install fzf to use the fzf selector") os.environ["FZF_DEFAULT_OPTS"] = self.config.opts diff --git a/fastanime/libs/selectors/inquirer/__init__.py b/viu/libs/selectors/inquirer/__init__.py similarity index 100% rename from fastanime/libs/selectors/inquirer/__init__.py rename to viu/libs/selectors/inquirer/__init__.py diff --git a/fastanime/libs/selectors/inquirer/selector.py b/viu/libs/selectors/inquirer/selector.py similarity index 100% rename from fastanime/libs/selectors/inquirer/selector.py rename to viu/libs/selectors/inquirer/selector.py diff --git a/fastanime/libs/selectors/rofi/__init__.py b/viu/libs/selectors/rofi/__init__.py similarity index 100% rename from fastanime/libs/selectors/rofi/__init__.py rename to viu/libs/selectors/rofi/__init__.py diff --git a/fastanime/libs/selectors/rofi/selector.py b/viu/libs/selectors/rofi/selector.py similarity index 100% rename from fastanime/libs/selectors/rofi/selector.py rename to viu/libs/selectors/rofi/selector.py diff --git a/fastanime/libs/selectors/selector.py b/viu/libs/selectors/selector.py similarity index 100% rename from fastanime/libs/selectors/selector.py rename to viu/libs/selectors/selector.py diff --git a/fastanime/fastanime.py b/viu/viu.py old mode 100755 new mode 100644 similarity index 92% rename from fastanime/fastanime.py rename to viu/viu.py index 75fce47..0ded14b --- a/fastanime/fastanime.py +++ b/viu/viu.py @@ -8,7 +8,7 @@ if getattr(sys, "frozen", False): sys.path.insert(0, application_path) # Import and run the main application -from fastanime import Cli +from viu import Cli if __name__ == "__main__": Cli()