mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-26 02:34:58 +08:00
fix: incase name not submitted
This commit is contained in:
@@ -303,13 +303,16 @@ func (s *Server) DownloadMovieTorrent(c *gin.Context) (interface{}, error) {
|
|||||||
return nil, errors.Wrap(err, "downloading")
|
return nil, errors.Wrap(err, "downloading")
|
||||||
}
|
}
|
||||||
torrent.Start()
|
torrent.Start()
|
||||||
|
name := in.Name
|
||||||
|
if name == "" {
|
||||||
|
name = media.OriginalName
|
||||||
|
}
|
||||||
go func() {
|
go func() {
|
||||||
ep := media.Episodes[0]
|
ep := media.Episodes[0]
|
||||||
history, err := s.db.SaveHistoryRecord(ent.History{
|
history, err := s.db.SaveHistoryRecord(ent.History{
|
||||||
MediaID: media.ID,
|
MediaID: media.ID,
|
||||||
EpisodeID: ep.ID,
|
EpisodeID: ep.ID,
|
||||||
SourceTitle: in.Name,
|
SourceTitle: name,
|
||||||
TargetDir: "./",
|
TargetDir: "./",
|
||||||
Status: history.StatusRunning,
|
Status: history.StatusRunning,
|
||||||
Size: in.Size,
|
Size: in.Size,
|
||||||
|
|||||||
Reference in New Issue
Block a user