fix last viewed

This commit is contained in:
YouROK
2021-01-29 14:55:23 +03:00
parent 189a8e60fa
commit bd103f7e89

View File

@@ -114,10 +114,10 @@ func searchLastPlayed(tor *state.TorrentStatus) int {
for i, stat := range tor.FileStats { for i, stat := range tor.FileStats {
if stat.Id == lastViewedIndex { if stat.Id == lastViewedIndex {
if i+1 >= len(tor.FileStats) { if i >= len(tor.FileStats) {
return -1 return -1
} }
return i + 1 return i
} }
} }