emericg / OpenSubtitlesDownload

Automatically find and download the right subtitles for your favorite videos!
https://emeric.io/OpenSubtitlesDownload
GNU General Public License v3.0
579 stars 63 forks source link

Correct indexing in selectionCLI's for loop (0 -> 1) #109

Closed YoureMySoul closed 5 months ago

YoureMySoul commented 6 months ago

Before:

>> Available subtitles:
[ 0] "Name.Of.The.Movie.1080p.x265"
[ 0] Cancel search

>> Enter your choice (0-0): 0
Cancelling search...
subIndex: -1
subName:

After:

>> Available subtitles:
[ 1] "Name.Of.The.Movie.1080p.x265"
[ 0] Cancel search

>> Enter your choice (0-1): 1
subIndex: 0
subName: Name.Of.The.Movie.1080p.x265

Before:

>> Available subtitles:
[ 0] "Name.Of.The.Movie.1080p.x265"
[ 1] > "HI" > "Name.Of.The.Movie.1080p.x265.Other"
[ 2] > "HI" > "Name.Of.The.Movie.1080p.x265.Another"
[ 0] Cancel search

>> Enter your choice (0-2): 1
subIndex: 0
subName: Name.Of.The.Movie.1080p.x265

After:

>> Available subtitles:
[ 1] "Name.Of.The.Movie.1080p.x265"
[ 2] > "HI" > "Name.Of.The.Movie.1080p.x265.Other"
[ 3] > "HI" > "Name.Of.The.Movie.1080p.x265.Another"
[ 0] Cancel search

>> Enter your choice (0-3): 1
subIndex: 0
subName: Name.Of.The.Movie.1080p.x265

Cancel [0] works as well.

emericg commented 5 months ago

Not sure if this is the best fix, but I did break that in the last update...