feat(Links): [Android Only] Attach module headers when viewing web GUI

This commit is contained in:
Jagandeep Brar
2021-04-18 12:38:44 -05:00
parent 7fa50e4cf8
commit 54cc4ad33d
7 changed files with 25 additions and 10 deletions

View File

@@ -126,7 +126,10 @@ class _State extends State<Lidarr> {
Future<void> _handlePopup() async {
List<dynamic> values = await LidarrDialogs.globalSettings(context);
if(values[0]) switch(values[1]) {
case 'web_gui': await _api.host?.toString()?.lunaOpenGenericLink(); break;
case 'web_gui':
ProfileHiveObject profile = Database.currentProfileObject;
await profile.lidarrHost?.lunaOpenGenericLink(headers: profile.lidarrHeaders);
break;
case 'update_library': await _api.updateLibrary()
.then((_) => showLunaSuccessSnackBar(title: 'Updating Library...', message: 'Updating your library in the background'))
.catchError((error) => showLunaErrorSnackBar(title: 'Failed to Update Library', error: error));

View File

@@ -99,7 +99,10 @@ class _State extends State<NZBGet> {
Future<void> _handlePopup() async {
List<dynamic> values = await NZBGetDialogs.globalSettings(context);
if(values[0]) switch(values[1]) {
case 'web_gui': _api.host.lunaOpenGenericLink(); break;
case 'web_gui':
ProfileHiveObject profile = Database.currentProfileObject;
await profile.nzbgetHost?.lunaOpenGenericLink(headers: profile.nzbgetHeaders);
break;
case 'add_nzb': _addNZB(); break;
case 'sort': _sort(); break;
case 'server_details': _serverDetails(); break;

View File

@@ -44,7 +44,9 @@ extension RadarrGlobalSettingsTypeExtension on RadarrGlobalSettingsType {
throw Exception('Invalid RadarrGlobalSettingsType');
}
Future<void> _webGUI(BuildContext context) async => context.read<RadarrState>().host.lunaOpenGenericLink();
Future<void> _webGUI(BuildContext context) async => context.read<RadarrState>().host.lunaOpenGenericLink(
headers: context.read<RadarrState>().headers,
);
Future<void> _backupDatabase(BuildContext context) async => RadarrAPIHelper().backupDatabase(context: context);
Future<void> _searchAllMissing(BuildContext context) async {
bool result = await RadarrDialogs().searchAllMissingMovies(context);

View File

@@ -99,7 +99,10 @@ class _State extends State<SABnzbd> {
Future<void> _handlePopup() async {
List<dynamic> values = await SABnzbdDialogs.globalSettings(context);
if(values[0]) switch(values[1]) {
case 'web_gui': _api.host.lunaOpenGenericLink(); break;
case 'web_gui':
ProfileHiveObject profile = Database.currentProfileObject;
await profile.sabnzbdHost?.lunaOpenGenericLink(headers: profile.sabnzbdHeaders);
break;
case 'add_nzb': _addNZB(); break;
case 'sort': _sort(); break;
case 'clear_history': _clearHistory(); break;

View File

@@ -22,7 +22,9 @@ class SonarrAppBarGlobalSettingsAction extends StatelessWidget {
}
}
Future<void> _webGUI(BuildContext context) async => Provider.of<SonarrState>(context, listen: false).host.lunaOpenGenericLink();
Future<void> _webGUI(BuildContext context) async => context.read<SonarrState>().host.lunaOpenGenericLink(
headers: context.read<SonarrState>().headers,
);
Future<void> _viewQueue(BuildContext context) async => SonarrQueueRouter().navigateTo(context);

View File

@@ -48,7 +48,9 @@ extension TautulliGlobalSettingsTypeExtension on TautulliGlobalSettingsType {
throw Exception('Invalid TautulliGlobalSettingsType');
}
Future<void> _webGUI(BuildContext context) async => context.read<TautulliState>().host.lunaOpenGenericLink();
Future<void> _webGUI(BuildContext context) async => context.read<TautulliState>().host.lunaOpenGenericLink(
headers: context.read<TautulliState>().headers,
);
Future<void> _backupConfig(BuildContext context) async => TautulliAPIHelper().backupConfiguration(context: context);
Future<void> _backupDatabase(BuildContext context) async => TautulliAPIHelper().backupDatabase(context: context);
Future<void> _deleteCache(BuildContext context) async => TautulliAPIHelper().deleteCache(context: context);