ani-cli
ani-cli copied to clipboard
The number of anime shown from history is inconsistent.
Metadata (please complete the following information) Version: 3.4.1 OS: Arch Linux Shell: zsh
Describe the bug
When I run ani-cli -c
, the number of anime shown changes in each run. See screenshot.
Steps To Reproduce
- Have a bunch of animes in your history file.
- Run
ani-cli -c
- Quit out by typing
q
after observing the number of anime shown. - Run
ani-cli -c
again.
Expected behavior The number of anime shown should be consistent
Screenshots
This is expected behaviour. The reason is that when you parse your history file, for each line the script checks if it is valid . Since there's a chance of new episodes being released, the script always checks for its validity. This involves web requests, which involve a lot of waiting (for the servers' answer). To avoid minute long waits, the script processes all entries at the same time. Because of this and the nature of the internet the answers come in an unpredictable order and are printed somewhat differently each time.
Since it was not critical, the output is not ordered by anything. If you explain why there's a good reason to be consistent we can talk about having a sorted output
I apologize, I probably wasn't clear. The issue I'm raising is not that the output is not sorted. It's that the number of the output is not consistent. If you look at the screenshot, the first time the output showed 14 animes but the second time I ran it immediately, the output showed 6 animes.
Oh I see... Can you tell us how to reproduce this state? I have never came across this before.
I tested and it appears it happens if I re run anicli immediately after exiting it. If I wait like 10 seconds, the issue does not occur. It also originally occurred when I watched an episode and then immediately ran anicli to watch another anime. So at this point I think it's only worth fixing if it's an easy fix because I can wait a few seconds to watch another anime.
@PhosCity does this behaviour persist? Have you figured out anything extra?
The behavior definitely persists. This may or may not be significant but I think if the number of animes in your history file is more, this behavior occurs more frequently. Since I started using ani-cli, I had never cleaned history file ever and the number of animes I had in my history file was 42 (most of them already completed shows). When I removed animes that I had already watched, this behavior reduced but not fully gone.
So while I cannot say that the cause is a lot of items in history, cleaning it has definitely helped a little.
I'm closing this because v4 is a full rewrite, including the history. Feel free to reopen it if we reintroduce the same issue.