Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Jul 19, 2024
1 parent e927d4a commit aabe649
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
13 changes: 12 additions & 1 deletion server/watchlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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")
}
Expand Down
19 changes: 12 additions & 7 deletions ui/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit aabe649

Please sign in to comment.