5rahim / seanime

Free and open-source media server for anime and manga that includes library scanning, downloading, transcoding, torrent streaming, and more.
https://seanime.rahim.app
MIT License
226 stars 16 forks source link

bug: No episode data found for specials #103

Closed TnTora closed 3 weeks ago

TnTora commented 1 month ago

Checklist

Bug Severity

Usability is affected

Bug Area

Other

Bug Description / Steps to Reproduce

When opening entries classified as SPECIAL, no episode metadata is available, making it impossible to interact with the entry. It seems anizip returns no episode information for this type of entries, but we do have the number of episodes available

Here are a couple of examples:

Expected Behavior

No response

Screenshots

image

Logs

|2024-07-21 13:17:14| |DBG| anilist > Fetching anime details mediaId=146922
|2024-07-21 13:17:14| |INF| api > Success latency=293.129469ms method=GET url=/api/v1/library/anime-entry/146922
|2024-07-21 13:17:14| |INF| anilist > Successful Request rlr=88 rtt=356ms
|2024-07-21 13:17:14| |INF| api > Success latency=356.535346ms method=GET url=/api/v1/anilist/media-details/146922
|2024-07-21 13:17:29| |INF| anilist > Successful Request rlr=87 rtt=202ms
|2024-07-21 13:17:29| |ERR| torrentstream > could not get media entry info, episodes to download is nil
|2024-07-21 13:17:29| |ERR| api > Error latency=202.310925ms method=GET url=/api/v1/torrentstream/episodes/146922

Debugging Checklist

App Version

v1.7.3

Operating System

MacOS

5rahim commented 1 month ago

This is a known limitation of the APIs I'm using and it's due to how AniList and AniDB class specials.

If you take Witch from mercury as an example you'll see that AniList has a separate entry for the prologue (hence why you can see the number of episodes), but AniDB classes it as a special episode (S1) under the main series.

AniDB is the "source of truth" for episode metadata in Seanime and currently Ani.zip is the only API that does the mapping automatically, so there's no way for me to solve this issue unless I rewrite the whole system.

As it stands, torrent streaming won't work but it's still possible to download episodes & match them - there'll be no images/metadata for them however.

TnTora commented 1 month ago

Thanks for the reply.

As a (hacky) workaround for torrent streaming, I was thinking of creating some dummy episode entries which would include only the episode number. This should at least allow to open the search drawer and possibly update the progress of the entry.

I've also been experimenting with adding a way to manually select the file you want from a batch torrent. The dummy episode + manual file selection is something I would probably be comfortable with for my personal use, but I'm not sure it would make a great general solution

5rahim commented 1 month ago

creating some dummy episode entries which would include only the episode number

Yep, that could be a solution, it is hacky but it's the only realistic option. Then forcing manual selection to avoid issues with auto-selection when episode metadata is absent.

I've also been experimenting with adding a way to manually select the file you want from a batch torrent

That could be a sub-option for manual section

TnTora commented 1 month ago

I made a first attempt at implementing these solutions in a fork. It seems to be working, but I have not tested it thoroughly.

I'm not sure about the quality of the code, since I'm not yet familiar with the languages and tools used in this project, but I hope it could work at least as a proof of concept.

5rahim commented 1 month ago

That's great, I'll use it as a template to implement those features. The current codebase is going to change a lot since I'm working on extension system for torrents & stuff.

5rahim commented 1 month ago

I implemented both manual selection & dummy episodes for specials in the v2 branch based on your commits. I'll keep testing it.

image

image

TnTora commented 1 month ago

Thanks. I'm trying to build from source so that I can test it but I'm running into the following error:

./src/api/hooks/manga_download.hooks.ts:8:59
Type error: Module '"@/api/generated/types"' has no exported member 'Manga_Provider'.

   6 | } from "@/api/generated/endpoint.types"
   7 | import { API_ENDPOINTS } from "@/api/generated/endpoints"
>  8 | import { Manga_DownloadListItem, Manga_MediaDownloadData, Manga_Provider, Models_ChapterDownloadQueueItem, Nullish } from "@/api/generated/types"
     |   
5rahim commented 1 month ago

I fixed the type error. The branch is still pretty unstable though.

TnTora commented 1 month ago

I managed to build from source but I had to deal with a few more type errors.

The same Manga_Provider error in the following files:

And one more:

./src/app/(main)/manga/_containers/chapter-reader/_components/chapter-page.tsx:1:10
Type error: Module '"@/api/generated/types"' has no exported member 'Manga_ChapterPage'.

Regarding the new features, they seem to be working great. One possible improvement would be to have the stream button in the file selection drawer fixed hovering near the bottom of the drawer so that you don't have to scroll all the way down (especially when dealing with torrents containing lots of files).

I'll keep using this version for now and if it ends up being too unstable I'll go back to the previous one.

5rahim commented 1 month ago

One possible improvement would be to have the stream button in the file selection drawer fixed hovering near the bottom

yup, I was planning to change that

I'll keep using this version for now and if it ends up being too unstable I'll go back to the previous one.

Feel free to report any other issues you encounter