From aabe649e40fad5a6136ca6492e6f35adbc3e9383 Mon Sep 17 00:00:00 2001 From: Simon Ding Date: Fri, 19 Jul 2024 18:15:30 +0800 Subject: [PATCH] chore: fixes --- server/watchlist.go | 13 ++++++++++++- ui/lib/main.dart | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/server/watchlist.go b/server/watchlist.go index 9edf831..1656cbf 100644 --- a/server/watchlist.go +++ b/server/watchlist.go @@ -158,6 +158,17 @@ func (s *Server) AddMovie2Watchlist(c *gin.Context) (interface{}, error) { } log.Infof("find detail for movie id %d: %v", in.TmdbID, detail) + epid, err := s.db.SaveEposideDetail(&ent.Episode{ + SeasonNumber: 1, + EpisodeNumber: 1, + Title: "dummy episode for movies", + Overview: "dummy episode for movies", + AirDate: detail.ReleaseDate, + }) + if err != nil { + return nil, errors.Wrap(err, "add dummy episode") + } + r, err := s.db.AddMediaWatchlist(&ent.Media{ TmdbID: int(detail.ID), MediaType: media.MediaTypeMovie, @@ -169,7 +180,7 @@ func (s *Server) AddMovie2Watchlist(c *gin.Context) (interface{}, error) { Resolution: string(in.Resolution), StorageID: in.StorageID, TargetDir: "./", - }, nil) + }, []int{epid}) if err != nil { return nil, errors.Wrap(err, "add to list") } diff --git a/ui/lib/main.dart b/ui/lib/main.dart index eff858f..2ec65ad 100644 --- a/ui/lib/main.dart +++ b/ui/lib/main.dart @@ -45,13 +45,18 @@ class MyApp extends StatelessWidget { return Container( constraints: const BoxConstraints(maxWidth: 300, maxHeight: 40), - child: SearchBar( - hintText: "搜索电影和电视剧...", - leading: const Icon(Icons.search), - controller: controller, - onSubmitted: (value) => context.go(Uri( - path: SearchPage.route, - queryParameters: {'query': value}).toString()), + child: Opacity( + opacity: 0.8, + child: SearchBar( + hintText: "搜索...", + leading: const Icon(Icons.search), + controller: controller, + shadowColor: WidgetStateColor.transparent, + backgroundColor: const WidgetStatePropertyAll(Color.fromARGB(255, 29, 78, 119)), + onSubmitted: (value) => context.go(Uri( + path: SearchPage.route, + queryParameters: {'query': value}).toString()), + ), ), ); }, suggestionsBuilder: