Enhance file sharing functionality: infer org_id when not provided, update share link responses to include shareUrl

This commit is contained in:
Leon Bösche
2026-01-24 23:16:51 +01:00
parent 421e95d83b
commit 82eba17a82
4 changed files with 154 additions and 97 deletions

View File

@@ -4,6 +4,7 @@ import 'package:web/web.dart' as web;
import '../theme/app_theme.dart';
import '../services/api_client.dart';
import '../injection.dart';
import '../widgets/audio_player_bar.dart';
class PublicFileViewer extends StatefulWidget {
final String token;
@@ -117,12 +118,23 @@ class _PublicFileViewerState extends State<PublicFileViewer> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.insert_drive_file,
size: 64,
color: AppTheme.primaryText,
),
const SizedBox(height: 16),
// If this is an audio file, show the audio player
if ((_fileData!['capabilities']?['mimeType'] ?? '')
.toString()
.startsWith('audio/')) ...[
AudioPlayerBar(
fileName: _fileData!['fileName'] ?? 'Audio',
fileUrl: _fileData!['downloadUrl'],
),
const SizedBox(height: 16),
] else ...[
Icon(
Icons.insert_drive_file,
size: 64,
color: AppTheme.primaryText,
),
const SizedBox(height: 16),
],
Text(
_fileData!['fileName'] ?? 'Unknown file',
style: TextStyle(