Get device code for authentication
All checks were successful
release / release-plugins (push) Successful in 25s

This commit is contained in:
mschuepbach
2024-03-16 11:27:17 +01:00
parent ab83ff0261
commit 2129228491
4 changed files with 75 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ use Slim::Utils::Log;
use Slim::Utils::Prefs;
my $log = logger('plugin.youtubemusic');
my $cache = Slim::Utils::Cache->new();
sub name {
return 'PLUGIN_YOUTUBEMUSIC';
@@ -27,6 +28,11 @@ sub handler {
preferences('plugin.youtubemusic')->set('testPref', $params->{'pref_testPref'});
}
Plugins::YouTubeMusic::OAuth2::getDeviceCode if $params->{get_device_code};
$params->{user_code} = $cache->get('yt:user_code');
$params->{verification_url} = $cache->get('yt:verification_url');
return $class->SUPER::handler($client, $params);
}