add cache

This commit is contained in:
YouROK
2020-12-07 15:55:54 +03:00
parent 30604c6e94
commit a5c1d5b4de
7 changed files with 142 additions and 8 deletions

View File

@@ -78,8 +78,8 @@ func GetMimeType(filename string) string {
return "*/*"
}
func GetPlayableFiles(st state.TorrentStatus) []state.TorrentFileStat {
files := make([]state.TorrentFileStat, 0)
func GetPlayableFiles(st state.TorrentStatus) []*state.TorrentFileStat {
files := make([]*state.TorrentFileStat, 0)
for _, f := range st.FileStats {
if GetMimeType(f.Path) != "*/*" {
files = append(files, f)