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