mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
chore: updates
This commit is contained in:
@@ -53,7 +53,7 @@ type addWatchlistIn struct {
|
|||||||
TmdbID int `json:"tmdb_id" binding:"required"`
|
TmdbID int `json:"tmdb_id" binding:"required"`
|
||||||
StorageID int `json:"storage_id" `
|
StorageID int `json:"storage_id" `
|
||||||
Resolution string `json:"resolution" binding:"required"`
|
Resolution string `json:"resolution" binding:"required"`
|
||||||
Folder string `json:"folder" binding:"required"`
|
Folder string `json:"folder"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) AddTv2Watchlist(c *gin.Context) (interface{}, error) {
|
func (s *Server) AddTv2Watchlist(c *gin.Context) (interface{}, error) {
|
||||||
@@ -61,6 +61,9 @@ func (s *Server) AddTv2Watchlist(c *gin.Context) (interface{}, error) {
|
|||||||
if err := c.ShouldBindJSON(&in); err != nil {
|
if err := c.ShouldBindJSON(&in); err != nil {
|
||||||
return nil, errors.Wrap(err, "bind query")
|
return nil, errors.Wrap(err, "bind query")
|
||||||
}
|
}
|
||||||
|
if (in.Folder == "") {
|
||||||
|
return nil, errors.New("folder should be provided")
|
||||||
|
}
|
||||||
detailCn, err := s.MustTMDB().GetTvDetails(in.TmdbID, db.LanguageCN)
|
detailCn, err := s.MustTMDB().GetTvDetails(in.TmdbID, db.LanguageCN)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "get tv detail")
|
return nil, errors.Wrap(err, "get tv detail")
|
||||||
@@ -160,6 +163,7 @@ func (s *Server) AddMovie2Watchlist(c *gin.Context) (interface{}, error) {
|
|||||||
AirDate: detail.ReleaseDate,
|
AirDate: detail.ReleaseDate,
|
||||||
Resolution: string(in.Resolution),
|
Resolution: string(in.Resolution),
|
||||||
StorageID: in.StorageID,
|
StorageID: in.StorageID,
|
||||||
|
TargetDir: "./",
|
||||||
}, nil)
|
}, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "add to list")
|
return nil, errors.Wrap(err, "add to list")
|
||||||
|
|||||||
@@ -161,7 +161,6 @@ class _SearchPageState extends ConsumerState<SearchPage> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
storage.when(
|
storage.when(
|
||||||
data: (v) {
|
data: (v) {
|
||||||
return Column(
|
return Column(
|
||||||
@@ -180,33 +179,31 @@ class _SearchPageState extends ConsumerState<SearchPage> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
item.mediaType == "tv"
|
||||||
name.when(
|
? name.when(
|
||||||
data: (s) {
|
data: (s) {
|
||||||
|
final path = v[storageSelected]
|
||||||
|
.settings!["tv_path"];
|
||||||
|
|
||||||
final path = item.mediaType == "tv"
|
|
||||||
? v[storageSelected]
|
|
||||||
.settings!["tv_path"]
|
|
||||||
: v[storageSelected]
|
|
||||||
.settings!["movie_path"];
|
|
||||||
pathController.text = s;
|
pathController.text = s;
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
//width: 300,
|
//width: 300,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
|
|
||||||
controller: pathController,
|
controller: pathController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: "存储路径",
|
labelText: "存储路径",
|
||||||
prefix: Text(path)
|
prefix: Text(path)),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
error: (error, stackTrace) => Text("$error"),
|
error: (error, stackTrace) =>
|
||||||
loading: () => const MyProgressIndicator(
|
Text("$error"),
|
||||||
|
loading: () =>
|
||||||
|
const MyProgressIndicator(
|
||||||
size: 20,
|
size: 20,
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
|
: Text(""),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user