Refactor file URL generation to use file path instead of file ID and adjust audio player bar width for improved layout

This commit is contained in:
Leon Bösche
2026-01-17 02:55:34 +01:00
parent 66ec456102
commit 0a23133043
3 changed files with 5 additions and 5 deletions

View File

@@ -1188,7 +1188,7 @@ class _FileExplorerState extends State<FileExplorer>
final fileService = getIt<FileService>();
final url = await fileService.getFileUrl(
orgId: widget.orgId,
fileId: file.id!,
filePath: file.path,
fileName: file.name,
);
// ignore: avoid_print

View File

@@ -118,13 +118,13 @@ class FileService {
Future<String> getFileUrl({
required String orgId,
required String fileId,
required String filePath,
String? fileName,
}) async {
// Return the full download URL
final path = orgId.isEmpty
? '/user/files/download?id=${Uri.encodeComponent(fileId)}'
: '/orgs/$orgId/files/download?id=${Uri.encodeComponent(fileId)}';
? '/user/files/download?path=${Uri.encodeComponent(filePath)}'
: '/orgs/$orgId/files/download?path=${Uri.encodeComponent(filePath)}';
return '$baseUrl$path';
}

View File

@@ -193,7 +193,7 @@ class _AudioPlayerBarState extends State<AudioPlayerBar>
height: 48,
width:
MediaQuery.of(context).size.width *
0.65, // Reduce width by 35% (100% - 35% = 65%)
0.25, // Reduce width to 25% for better fit
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
decoration: AppTheme.glassDecoration.copyWith(
borderRadius: BorderRadius.circular(16),