feat: edit media details

This commit is contained in:
Simon Ding
2024-08-06 23:00:56 +08:00
parent 8ab33f3d54
commit 466596345d
12 changed files with 276 additions and 101 deletions

View File

@@ -10,6 +10,7 @@ import (
"polaris/log"
"polaris/pkg/notifier"
"polaris/pkg/storage"
"strings"
"github.com/pkg/errors"
)
@@ -55,6 +56,10 @@ func (c *Client) writePlexmatch(seriesId int, episodeId int, targetDir, name str
} else {
buff.Write(data)
}
if strings.Contains(buff.String(), name) {
log.Debugf("already write plex episode line: %v", name)
return nil
}
buff.WriteString(fmt.Sprintf("\nep: %d: %s\n", ep.EpisodeNumber, name))
log.Infof("write season plexmatch file content: %s", buff.String())
return st.WriteFile(seasonPlex, buff.Bytes())