Skip to content

Commit

Permalink
fix: no pre path
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Jul 14, 2024
1 parent 792a470 commit a465468
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"polaris/ent"
"polaris/ent/downloadclients"
"polaris/ent/episode"
Expand Down Expand Up @@ -89,16 +88,13 @@ func (c *Client) AddWatchlist(storageId int, nameCn, nameEn string, detail *tmdb
storageId = r.ID
}
}
st := c.GetStorage(storageId)

targetDir := fmt.Sprintf("%s %s (%v)", nameCn, nameEn, strings.Split(detail.FirstAirDate, "-")[0])
if !utils.IsChineseChar(nameCn) {
log.Warnf("name cn is not chinese name: %v", nameCn)
targetDir = fmt.Sprintf("%s (%v)", nameEn, strings.Split(detail.FirstAirDate, "-")[0])
}

targetDir = filepath.Join(st.GetPath(), targetDir)

r, err := c.ent.Series.Create().
SetTmdbID(int(detail.ID)).
SetStorageID(storageId).
Expand Down

0 comments on commit a465468

Please sign in to comment.