diff --git a/lib/moviesPage/functions/check_xprime.dart b/lib/moviesPage/functions/check_xprime.dart index 3f2edc1..c895f19 100644 --- a/lib/moviesPage/functions/check_xprime.dart +++ b/lib/moviesPage/functions/check_xprime.dart @@ -1,14 +1,14 @@ import 'package:http/http.dart' as http; import 'dart:convert'; -const String _encodedBaseUrl = 'aHR0cHM6Ly94cHJpbWUudHYvcHJpbWVib3g/aWQ9'; +const String _encodedBaseUrl = 'aHR0cHM6Ly94cHJpbWUudHYvcHJpbWVib3g/bmFtZT0='; String get baseStreamUrl => utf8.decode(base64.decode(_encodedBaseUrl)); -Future checkXprime(int movieId) async { +Future checkXprime(int movieId, String movieName) async { try { final response = await http.get(Uri.parse( - '$baseStreamUrl$movieId')); + '$baseStreamUrl$movieName')); if (response.statusCode == 200) { final data = json.decode(response.body); @@ -26,10 +26,10 @@ Future checkXprime(int movieId) async { } -Future checkXprimeSeries(int serieId, int seasonNumber, int episodeNumber) async { +Future checkXprimeSeries(int serieId, int seasonNumber, int episodeNumber, String serieName) async { try { final response = await http.get(Uri.parse( - '$baseStreamUrl$serieId&season=$seasonNumber&episode=$episodeNumber')); + '$baseStreamUrl$serieName&season=$seasonNumber&episode=$episodeNumber')); if (response.statusCode == 200) { final data = json.decode(response.body); diff --git a/lib/moviesPage/functions/to_video_player.dart b/lib/moviesPage/functions/to_video_player.dart index 50a1472..a387899 100644 --- a/lib/moviesPage/functions/to_video_player.dart +++ b/lib/moviesPage/functions/to_video_player.dart @@ -7,7 +7,7 @@ import 'package:http/http.dart' as http; import 'dart:convert'; import 'dart:io'; -const String _encodedBaseUrl = 'aHR0cHM6Ly94cHJpbWUudHYvcHJpbWVib3g/aWQ9'; +const String _encodedBaseUrl = 'aHR0cHM6Ly94cHJpbWUudHYvcHJpbWVib3g/bmFtZT0='; String get baseStreamUrl => utf8.decode(base64.decode(_encodedBaseUrl)); @@ -34,10 +34,10 @@ Color getColor(BuildContext context, int movieId) { return getMovieColor(context, movieId); } -Future> fetchSourcesDirect(int movieId) async { +Future> fetchSourcesDirect(int movieId, String movieName) async { try { final response = await http.get(Uri.parse( - '$baseStreamUrl$movieId')); + '$baseStreamUrl$movieName')); if (response.statusCode == 200) { return Map.from(json.decode(response.body)); @@ -49,9 +49,9 @@ Future> fetchSourcesDirect(int movieId) async { } } -void showWatchOptionsDirect(BuildContext context, int movieId) async { +void showWatchOptionsDirect(BuildContext context, int movieId, String movieName) async { // Fetch sources dynamically - Map response = await fetchSourcesDirect(movieId); + Map response = await fetchSourcesDirect(movieId, movieName); // Get available qualities and streams List availableQualities = List.from(response['available_qualities'] ?? []); @@ -77,9 +77,16 @@ void showWatchOptionsDirect(BuildContext context, int movieId) async { ), ), const CustomDivider(), - Expanded( - child: ListView.builder( - itemCount: availableQualities.length, + if (availableQualities.isEmpty) + const Expanded( + child: Center( + child: Text('No streams available', style: TextStyle(color: Colors.redAccent),), + ), + ) + else + Expanded( + child: ListView.builder( + itemCount: availableQualities.length, itemBuilder: (BuildContext context, int index) { String quality = availableQualities[index]; String? streamUrl = streams[quality]; diff --git a/lib/moviesPage/movieDetailPage.dart b/lib/moviesPage/movieDetailPage.dart index 87124c5..91897c1 100644 --- a/lib/moviesPage/movieDetailPage.dart +++ b/lib/moviesPage/movieDetailPage.dart @@ -87,7 +87,7 @@ class _MovieDetailPageState extends State { final region = Provider.of(context, listen: false).currentRegion; fetchCredits(widget.movieId, region); - checkXprime(widget.movieId).then((value) { + checkXprime(widget.movieId, widget.movieTitle).then((value) { setState(() { xprimeAvailable = value; }); @@ -898,7 +898,8 @@ class _MovieDetailPageState extends State { child: FloatingActionButton( onPressed: () => showWatchOptionsDirect( context, - widget.movieId), + widget.movieId, + widget.movieTitle), child: Image.asset( 'assets/images/vlc.png', width: 30, diff --git a/lib/moviesPage/movieDetailPageDesktop.dart b/lib/moviesPage/movieDetailPageDesktop.dart index 9ffb3bf..a3f5182 100644 --- a/lib/moviesPage/movieDetailPageDesktop.dart +++ b/lib/moviesPage/movieDetailPageDesktop.dart @@ -85,7 +85,7 @@ class _MovieDetailPageDesktopState extends State { final region = Provider.of(context, listen: false).currentRegion; fetchCredits(widget.movieId, region); - checkXprime(widget.movieId).then((value) { + checkXprime(widget.movieId, widget.movieTitle).then((value) { setState(() { xprimeAvailable = value; }); @@ -756,7 +756,9 @@ class _MovieDetailPageDesktopState extends State { onPressed: () => showWatchOptionsDirect( context, widget - .movieId), + .movieId, + widget + .movieTitle), child: Image.asset( 'assets/images/vlc.png', width: 30, diff --git a/lib/seriesPage/UI/seasons_details.dart b/lib/seriesPage/UI/seasons_details.dart index cfad477..b453e30 100644 --- a/lib/seriesPage/UI/seasons_details.dart +++ b/lib/seriesPage/UI/seasons_details.dart @@ -455,7 +455,7 @@ void episodeDetails(int seasonNumber, int episodeNumber, BuildContext context, future: Future.wait([ fetchEpisodesDetails(context, seasonNumber, episodeNumber, serieId), fetchImdbRating(imdbId, seasonNumber, episodeNumber), - checkXprimeSeries(serieId, seasonNumber, episodeNumber) + checkXprimeSeries(serieId, seasonNumber, episodeNumber, serieName) ]).then((results) => {'episodeDetails': results[0], 'imdbRating': results[1], 'xprimeAvailable': results[2]}), builder: (context, snapshot) { diff --git a/lib/seriesPage/function/to_video_player_series.dart b/lib/seriesPage/function/to_video_player_series.dart index 34e757e..301ec1a 100644 --- a/lib/seriesPage/function/to_video_player_series.dart +++ b/lib/seriesPage/function/to_video_player_series.dart @@ -7,7 +7,7 @@ import 'package:http/http.dart' as http; import 'dart:convert'; import 'dart:io'; -const String _encodedBaseUrl = 'aHR0cHM6Ly94cHJpbWUudHYvcHJpbWVib3g/aWQ9'; +const String _encodedBaseUrl = 'aHR0cHM6Ly94cHJpbWUudHYvcHJpbWVib3g/bmFtZT0='; String get baseStreamUrl => utf8.decode(base64.decode(_encodedBaseUrl)); @@ -20,8 +20,7 @@ Future _openInVLC(String url) async { } else if (Platform.isMacOS) { await Process.run('/Applications/VLC.app/Contents/MacOS/VLC', [url]); } else if (Platform.isAndroid) { - final cleanUrl = url.replaceFirst(RegExp(r'^https?://'), ''); - await launchUrlString('vlc://$cleanUrl'); + await launchUrlString('vlc://$url'); } else { throw Exception('Platform not supported for VLC'); } @@ -77,9 +76,16 @@ void showWatchOptionsDirectTV(BuildContext context, int serieId, int seasonNumbe ), ), const CustomDivider(), - Expanded( - child: ListView.builder( - itemCount: availableQualities.length, + if (availableQualities.isEmpty) + const Expanded( + child: Center( + child: Text('No streams available', style: TextStyle(color: Colors.redAccent),), + ), + ) + else + Expanded( + child: ListView.builder( + itemCount: availableQualities.length, itemBuilder: (BuildContext context, int index) { String quality = availableQualities[index]; String? streamUrl = streams[quality]; diff --git a/pkg/PKGBUILD b/pkg/PKGBUILD index 427a584..f696dde 100644 --- a/pkg/PKGBUILD +++ b/pkg/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: mirarrapp pkgname=mirarr-bin -pkgver=1.9.0 +pkgver=1.9.1 pkgrel=1 pkgdesc="A Flutter-based movie and TV show app" arch=('x86_64') diff --git a/pubspec.lock b/pubspec.lock index 3e9ee63..948d355 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: args - sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.6.0" + version: "2.7.0" async: dependency: transitive description: @@ -93,10 +93,10 @@ packages: dependency: "direct main" description: name: connectivity_plus - sha256: "04bf81bb0b77de31557b58d052b24b3eee33f09a6e7a8c68a3e247c7df19ec27" + sha256: "051849e2bd7c7b3bc5844ea0d096609ddc3a859890ec3a9ac4a65a2620cc1f99" url: "https://pub.dev" source: hosted - version: "6.1.3" + version: "6.1.4" connectivity_plus_platform_interface: dependency: transitive description: @@ -149,10 +149,10 @@ packages: dependency: transitive description: name: dio_web_adapter - sha256: e485c7a39ff2b384fa1d7e09b4e25f755804de8384358049124830b04fc4f93a + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" fake_async: dependency: transitive description: @@ -165,10 +165,10 @@ packages: dependency: transitive description: name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" file: dependency: transitive description: @@ -268,18 +268,18 @@ packages: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" internet_connection_checker_plus: dependency: "direct main" description: name: internet_connection_checker_plus - sha256: "11e7ff6cbab22dbd2af4b21618dc0ffa77a345de3fdd2a138b05d17075f84ffa" + sha256: "5aea4a1ee0fcca736980a7d04d96fe8c0b53dea330690053305a5c5392230112" url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "2.7.2" intl: dependency: "direct main" description: @@ -348,10 +348,10 @@ packages: dependency: transitive description: name: mime - sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "2.0.0" nested: dependency: transitive description: @@ -388,10 +388,10 @@ packages: dependency: transitive description: name: package_info_plus_platform_interface - sha256: "205ec83335c2ab9107bbba3f8997f9356d72ca3c715d2f038fc773d0366b4c76" + sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.2.0" path: dependency: transitive description: @@ -412,10 +412,10 @@ packages: dependency: transitive description: name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" + sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 url: "https://pub.dev" source: hosted - version: "2.2.10" + version: "2.2.17" path_provider_foundation: dependency: transitive description: @@ -452,10 +452,10 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.1.0" platform: dependency: transitive description: @@ -476,10 +476,10 @@ packages: dependency: "direct main" description: name: provider - sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c + sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.5" rxdart: dependency: transitive description: @@ -524,18 +524,18 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82" + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.5.3" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" + sha256: "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.10" shared_preferences_foundation: dependency: transitive description: @@ -564,10 +564,10 @@ packages: dependency: transitive description: name: shared_preferences_web - sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.3" shared_preferences_windows: dependency: transitive description: @@ -601,18 +601,42 @@ packages: dependency: transitive description: name: sqflite - sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + sha256: e2297b1da52f127bc7a3da11439985d9b536f75070f3325e62ada69a5c585d03 url: "https://pub.dev" source: hosted - version: "2.3.3+1" + version: "2.4.2" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "2b3070c5fa881839f8b402ee4a39c1b4d561704d4ebbbcfb808a119bc2a1701b" + url: "https://pub.dev" + source: hosted + version: "2.4.1" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + sha256: "84731e8bfd8303a3389903e01fb2141b6e59b5973cacbb0929021df08dddbe8b" url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "2.5.5" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" stack_trace: dependency: transitive description: @@ -641,10 +665,10 @@ packages: dependency: transitive description: name: synchronized - sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + sha256: "0669c70faae6270521ee4f05bffd2919892d42d1276e6c495be80174b6bc0ef6" url: "https://pub.dev" source: hosted - version: "3.1.0+1" + version: "3.3.1" term_glyph: dependency: transitive description: @@ -665,18 +689,18 @@ packages: dependency: "direct main" description: name: tmdb_api - sha256: "7dfe81f37442b4b9996d410cde579eb7fbad58e17f4b4bbc17f2f091071ad25c" + sha256: "452c68c558f9e22226c9da1e8ff6e4dd44d1cd8b16712a26aaac10cd68ba7380" url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.3" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" url_launcher: dependency: "direct main" description: @@ -689,18 +713,18 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79 + sha256: "8582d7f6fe14d2652b4c45c9b6c14c0b678c2af2d083a11b604caeba51930d79" url: "https://pub.dev" source: hosted - version: "6.3.9" + version: "6.3.16" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" + sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb" url: "https://pub.dev" source: hosted - version: "6.3.2" + version: "6.3.3" url_launcher_linux: dependency: transitive description: @@ -729,10 +753,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.1" url_launcher_windows: dependency: transitive description: @@ -769,10 +793,10 @@ packages: dependency: transitive description: name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" webfeed_plus: dependency: "direct main" description: @@ -785,10 +809,10 @@ packages: dependency: transitive description: name: win32 - sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" + sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba" url: "https://pub.dev" source: hosted - version: "5.5.4" + version: "5.13.0" window_manager: dependency: "direct main" description: @@ -814,5 +838,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.7.0-0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.7.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml index c56b51d..0aa6560 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: Mirarr description: A new Flutter project. publish_to: "none" # Remove this line if you wish to publish to pub.dev -version: 1.9.0 +version: 1.9.1 environment: sdk: ">=3.4.3 <4.0.0"