Merge branch 'main' into plex-recommendation-on-discover-screen-28
This commit is contained in:
@@ -396,6 +396,7 @@ jobs:
|
||||
COMMIT_SHA=$(git rev-parse HEAD)
|
||||
|
||||
echo "Version: $VERSION"
|
||||
echo "Flutter SDK Version: $FLUTTER_VERSION"
|
||||
echo "Date: $DATE"
|
||||
echo "Commit SHA: $COMMIT_SHA"
|
||||
|
||||
@@ -403,8 +404,8 @@ jobs:
|
||||
sed -i "s/{{VERSION}}/$VERSION/g" linux/com.edde746.plezy.metainfo.xml
|
||||
sed -i "s/{{DATE}}/$DATE/g" linux/com.edde746.plezy.metainfo.xml
|
||||
|
||||
# Replace commit SHA placeholder in manifest
|
||||
sed -i "s/{{COMMIT_SHA}}/$COMMIT_SHA/g" linux/com.edde746.plezy.yml
|
||||
# Replace placeholders in manifest
|
||||
sed -i "s|{{COMMIT_SHA}}|$COMMIT_SHA|g" linux/com.edde746.plezy.yml
|
||||
|
||||
- name: Preprocess Flatpak manifest with flatpak-flutter
|
||||
run: |
|
||||
@@ -433,7 +434,15 @@ jobs:
|
||||
path: plezy.flatpak
|
||||
|
||||
create-release:
|
||||
needs: [build-android, build-ios, build-macos, build-windows, build-linux, build-flatpak]
|
||||
needs:
|
||||
[
|
||||
build-android,
|
||||
build-ios,
|
||||
build-macos,
|
||||
build-windows,
|
||||
build-linux,
|
||||
build-flatpak,
|
||||
]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
@@ -17,7 +17,7 @@ Plezy is a modern Plex media client that provides a seamless streaming experienc
|
||||
<a href='https://apps.apple.com/us/app/id6754315964'><img height='60' alt='Download on the App Store' src='./assets/app-store-badge.png'/></a>
|
||||
<a href='https://play.google.com/store/apps/details?id=com.edde746.plezy'><img height='60' alt='Get it on Google Play' src='./assets/play-store-badge.png'/></a>
|
||||
|
||||
> Google Play version is in closed testing ([required by Google](https://support.google.com/googleplay/android-developer/answer/14151465#overview)). Join the [Google Group](https://groups.google.com/g/plezy-testers) to get access.
|
||||
> Google Play version is in closed testing ([required by Google](https://support.google.com/googleplay/android-developer/answer/14151465#overview)). Join the [Google Group](https://groups.google.com/g/plezy-testers-2) to get access.
|
||||
|
||||
### Desktop
|
||||
- [Windows (x64)](https://github.com/edde746/plezy/releases/latest/download/plezy-windows-installer.exe)
|
||||
|
||||
+49
-14
@@ -703,21 +703,39 @@ class PlexClient {
|
||||
/// Get available sort options for a library section
|
||||
Future<List<PlexSort>> getLibrarySorts(String sectionId) async {
|
||||
try {
|
||||
// Fetch library content with minimal data to get Sort metadata
|
||||
final response = await _dio.get(
|
||||
'/library/sections/$sectionId/all',
|
||||
queryParameters: {'X-Plex-Container-Size': 0},
|
||||
);
|
||||
// Use the dedicated sorts endpoint
|
||||
final response = await _dio.get('/library/sections/$sectionId/sorts');
|
||||
|
||||
final container = _getMediaContainer(response);
|
||||
if (container != null && container['Sort'] != null) {
|
||||
return (container['Sort'] as List)
|
||||
.map((json) => PlexSort.fromJson(json as Map<String, dynamic>))
|
||||
.toList();
|
||||
// Parse the Directory array (not Sort array) per the API spec
|
||||
final sorts = _extractDirectoryList(response, PlexSort.fromJson);
|
||||
|
||||
if (sorts.isNotEmpty) {
|
||||
return sorts;
|
||||
}
|
||||
|
||||
// Fallback: return common sort options if API doesn't provide them
|
||||
return [
|
||||
return _getFallbackSorts(sectionId);
|
||||
} catch (e) {
|
||||
appLogger.e('Failed to get library sorts: $e');
|
||||
// Return fallback sort options on error
|
||||
return _getFallbackSorts(sectionId);
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<PlexSort>> _getFallbackSorts(String sectionId) async {
|
||||
try {
|
||||
// Get library type to determine which sorts to include
|
||||
final librariesResponse = await _dio.get('/library/sections');
|
||||
final libraries = _extractDirectoryList(
|
||||
librariesResponse,
|
||||
PlexLibrary.fromJson,
|
||||
);
|
||||
final library = libraries.firstWhere(
|
||||
(lib) => lib.key == sectionId,
|
||||
orElse: () => libraries.first,
|
||||
);
|
||||
|
||||
final fallbackSorts = <PlexSort>[
|
||||
PlexSort(key: 'titleSort', title: 'Title', defaultDirection: 'asc'),
|
||||
PlexSort(
|
||||
key: 'addedAt',
|
||||
@@ -725,6 +743,21 @@ class PlexClient {
|
||||
title: 'Date Added',
|
||||
defaultDirection: 'desc',
|
||||
),
|
||||
];
|
||||
|
||||
// Add "Latest Episode Air Date" only for TV show libraries
|
||||
if (library.type.toLowerCase() == 'show') {
|
||||
fallbackSorts.add(
|
||||
PlexSort(
|
||||
key: 'episode.originallyAvailableAt',
|
||||
descKey: 'episode.originallyAvailableAt:desc',
|
||||
title: 'Latest Episode Air Date',
|
||||
defaultDirection: 'desc',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
fallbackSorts.addAll([
|
||||
PlexSort(
|
||||
key: 'originallyAvailableAt',
|
||||
descKey: 'originallyAvailableAt:desc',
|
||||
@@ -737,10 +770,12 @@ class PlexClient {
|
||||
title: 'Rating',
|
||||
defaultDirection: 'desc',
|
||||
),
|
||||
];
|
||||
]);
|
||||
|
||||
return fallbackSorts;
|
||||
} catch (e) {
|
||||
appLogger.e('Failed to get library sorts: $e');
|
||||
// Return fallback sort options on error
|
||||
appLogger.e('Failed to get fallback sorts: $e');
|
||||
// Return minimal fallback options
|
||||
return [
|
||||
PlexSort(key: 'titleSort', title: 'Title', defaultDirection: 'asc'),
|
||||
PlexSort(
|
||||
|
||||
@@ -76,11 +76,10 @@ modules:
|
||||
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/edde746/plex-flutter.git
|
||||
url: https://github.com/edde746/plezy.git
|
||||
commit: {{COMMIT_SHA}}
|
||||
|
||||
- type: git
|
||||
url: https://github.com/flutter/flutter.git
|
||||
# NOTE: This will be replaced with SDK modules by flatpak-flutter preprocessing
|
||||
tag: stable
|
||||
tag: 3.35.6
|
||||
dest: flutter
|
||||
|
||||
Reference in New Issue
Block a user