From adf5f8905bed9af198320c2f8be4a0ab100fbd72 Mon Sep 17 00:00:00 2001 From: YouROK <8yourok8@mail.ru> Date: Thu, 11 Mar 2021 20:41:05 +0300 Subject: [PATCH] fix add subs to m3u --- server/web/api/m3u.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/web/api/m3u.go b/server/web/api/m3u.go index ef14a8a..449a3c9 100644 --- a/server/web/api/m3u.go +++ b/server/web/api/m3u.go @@ -108,13 +108,14 @@ func getM3uList(tor *state.TorrentStatus, host string, fromLast bool) string { } func findSubs(files []*state.TorrentFileStat, file *state.TorrentFileStat) *state.TorrentFileStat { - name := strings.TrimSuffix(file.Path, filepath.Ext(file.Path)) + name := filepath.Base(strings.TrimSuffix(file.Path, filepath.Ext(file.Path))) for _, f := range files { - if f.Path == name+".srt" { + fname := strings.ToLower(filepath.Base(f.Path)) + if fname == strings.ToLower(name+".srt") { return f } - if f.Path == name+".ass" { + if fname == strings.ToLower(name+".ass") { return f } }