Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion lib/core/services/api/key_service.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/// Compact ApiKeyService using BasePodService infrastructure.
/// Reduced from 575 to ~280 lines by using BasePodService patterns.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
15 changes: 15 additions & 0 deletions lib/core/services/favorites/movie_list_file_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
20 changes: 19 additions & 1 deletion lib/core/services/favorites/movie_list_service.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/// Compact MovieListService using composition with helper classes.
/// Reduced from 1,247 to ~220 lines by extracting operations to helpers.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
19 changes: 19 additions & 0 deletions lib/core/services/favorites/operations_helper.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
/// Helper class for MovieListService CRUD operations.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
20 changes: 19 additions & 1 deletion lib/core/services/pod/favorites/pod_favorites_cache_manager.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/// Cache management for POD favorites service.
/// Handles movie caching and file tracking operations.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
20 changes: 19 additions & 1 deletion lib/core/services/pod/favorites/pod_favorites_file_handler.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/// File handling operations for POD favorites service.
/// Handles TTL parsing and movie data loading operations.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/// List operations for POD favorites service.
/// Handles custom list management and operations.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/// Movie operations for POD favorites service.
/// Handles adding/removing movies from watch lists and movie-related queries.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
20 changes: 19 additions & 1 deletion lib/core/services/pod/favorites_service.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/// POD-based service for managing favorite movies using decomposed operations.
/// Facade service delegating to specialized operation classes.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
15 changes: 15 additions & 0 deletions lib/core/services/pod/file_operations_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
20 changes: 19 additions & 1 deletion lib/screens/my_movies_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import 'package:moviestar/screens/movie_details_screen.dart';
import 'package:moviestar/services/user_profile_service.dart';
import 'package:moviestar/utils/movie_sort_util.dart';
import 'package:moviestar/utils/serializer.dart';
import 'package:moviestar/utils/sort_preference_service.dart';
import 'package:moviestar/widgets/base_screen.dart';
import 'package:moviestar/widgets/moviestar_batch_sharing_ui.dart';
import 'package:moviestar/widgets/sort_controls.dart';
Expand All @@ -62,10 +63,26 @@ class MyMoviesScreen extends StatefulWidget {
/// State class for the my movies screen.

class _MyMoviesScreenState extends State<MyMoviesScreen> with ScreenStateMixin {
/// Currently selected sort criteria.
static const String _sortKey = 'my_movies';

MovieSortCriteria _sortCriteria = MovieSortCriteria.nameAsc;

@override
void initState() {
super.initState();
_loadSortPreference();
}

Future<void> _loadSortPreference() async {
final saved = await SortPreferenceService.load(
_sortKey,
fallback: MovieSortCriteria.nameAsc,
);
if (mounted) {
setState(() => _sortCriteria = saved);
}
}

/// Gets movies that the user has rated (combines both to watch and watched movies with ratings).

Stream<List<Movie>> get _ratedMovies async* {
Expand Down Expand Up @@ -152,6 +169,7 @@ Recipients will be able to:
safeSetState(() {
_sortCriteria = criteria;
});
SortPreferenceService.save(_sortKey, criteria);
},
),
Expanded(
Expand Down
20 changes: 19 additions & 1 deletion lib/screens/shared_movie_list_detail_screen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
/// Shared Movie List Detail Screen for MovieStar using decomposed components.
/// Facade screen delegating to specialized operation classes.
///
/// Copyright (C) 2025, Software Innovation Institute, ANU.
///
/// Licensed under the GNU General Public License, Version 3 (the "License").
///
/// License: https://opensource.org/license/gpl-3-0.
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://opensource.org/license/gpl-3-0>.
///
/// Authors: Ashley Tang, Kevin Wang

library;

Expand Down
20 changes: 19 additions & 1 deletion lib/screens/to_watch_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import 'package:moviestar/models/movie.dart';
import 'package:moviestar/services/user_profile_service.dart';
import 'package:moviestar/utils/movie_sort_util.dart';
import 'package:moviestar/utils/navigation_utils.dart';
import 'package:moviestar/utils/sort_preference_service.dart';
import 'package:moviestar/utils/serializer.dart';
import 'package:moviestar/widgets/base_screen.dart';
import 'package:moviestar/widgets/movie_list_widget.dart';
Expand All @@ -62,10 +63,26 @@ class ToWatchScreen extends StatefulWidget {
/// State class for the to watch screen.

class _ToWatchScreenState extends State<ToWatchScreen> with ScreenStateMixin {
/// Currently selected sort criteria.
static const String _sortKey = 'towatch';

MovieSortCriteria _sortCriteria = MovieSortCriteria.nameAsc;

@override
void initState() {
super.initState();
_loadSortPreference();
}

Future<void> _loadSortPreference() async {
final saved = await SortPreferenceService.load(
_sortKey,
fallback: MovieSortCriteria.nameAsc,
);
if (mounted) {
setState(() => _sortCriteria = saved);
}
}

@override
Widget build(BuildContext context) {
return BaseScreen(
Expand Down Expand Up @@ -128,6 +145,7 @@ Recipients will be able to:
safeSetState(() {
_sortCriteria = criteria;
});
SortPreferenceService.save(_sortKey, criteria);
},
onMovieTap: (movie) {
safeNavigateTo(
Expand Down
Loading
Loading