Alot of changes

This commit is contained in:
ImBenji
2024-05-01 12:29:59 +01:00
parent 8cc4016836
commit fc4d3ef898
23 changed files with 1755 additions and 430 deletions

View File

@@ -67,19 +67,17 @@ class LiveInformation {
syncedTimeModule = SyncedTimeModule();
announcementModule = AnnouncementModule();
// Tracker module is not supported on desktop
if (defaultTargetPlatform != TargetPlatform.windows && defaultTargetPlatform != TargetPlatform.linux && defaultTargetPlatform != TargetPlatform.macOS) {
// Tracker module is not supported on web
Permission.location.request().then((value) {
if (value.isGranted) {
trackerModule = TrackerModule();
}
});
}
initTrackerModule();
print("Initialised LiveInformation");
}
Future<void> initTrackerModule() async {
if (await Permission.location.isGranted) {
trackerModule = TrackerModule();
}
}
// Auth
AuthAPI auth = AuthAPI();
@@ -120,7 +118,15 @@ class LiveInformation {
// Cache/Load the audio files
await announcementModule
.announcementCache
.loadAnnouncementsFromBytes(await LiveInformation().announcementModule.getBundleBytes(), audioFiles);
.loadAnnouncementsFromBytes(await LiveInformation().announcementModule.getBundleBytes(), [
...audioFiles,
if (!routeVariant.busRoute.routeNumber.toLowerCase().startsWith("ul"))
"R_${routeVariant.busRoute.routeNumber}_001.mp3"
else
"R_RAIL_REPLACEMENT_SERVICE_001.mp3",
]
);
}
// Public methods