didvanplus → open the video player directly with link

This commit is contained in:
Mohamad Mahdi Jebeli 2026-06-22 09:13:20 +03:30
parent b793cb2a4b
commit 7710b5cab8
1 changed files with 18 additions and 1 deletions

View File

@ -312,7 +312,24 @@ class HomeWidgetRepository {
break; break;
case 'didvanplus': case 'didvanplus':
route = Routes.didvanPlusList; // Open the player directly. We don't have a full DidvanPlusModel
// here (no record in the legacy DB), so we synthesize one from
// the notification payload the player only reads file/image/
// title/description.
if (localData.link != null && localData.link!.isNotEmpty) {
route = Routes.didvanPlusVideo;
args = DidvanPlusModel(
id: 0, // unused for navigation
title: localData.title ?? '',
description: localData.body ?? '',
image: localData.imageUrl ?? '',
file: localData.link!,
publishedAt: DateTime.now().toIso8601String(),
);
} else {
// Fallback: no video URL just show the list.
route = Routes.didvanPlusList;
}
break; break;
case 'didvanvoice': case 'didvanvoice':