mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
remove stringInSlice and switch to ElementInSlice
This commit is contained in:
parent
136d970fec
commit
b42c87c9f8
1 changed files with 1 additions and 10 deletions
|
|
@ -530,21 +530,12 @@ func archiveDownloadVideos(downloader crunchyroll.Downloader, filename string, v
|
||||||
return files, nil
|
return files, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func stringInSlice(a string, list []string) bool {
|
|
||||||
for _, b := range list {
|
|
||||||
if b == a {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func archiveDownloadSubtitles(filename string, subtitles ...*crunchyroll.Subtitle) ([]string, error) {
|
func archiveDownloadSubtitles(filename string, subtitles ...*crunchyroll.Subtitle) ([]string, error) {
|
||||||
var files []string
|
var files []string
|
||||||
|
|
||||||
for _, subtitle := range subtitles {
|
for _, subtitle := range subtitles {
|
||||||
if len(archiveSubLanguagesFlag) > 0 {
|
if len(archiveSubLanguagesFlag) > 0 {
|
||||||
if !stringInSlice(string(subtitle.Locale), archiveSubLanguagesFlag) {
|
if !utils.ElementInSlice(string(subtitle.Locale), archiveSubLanguagesFlag) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue