Skip to content

Commit

Permalink
make CTI compatible with CBM
Browse files Browse the repository at this point in the history
  • Loading branch information
AF-1 committed Aug 18, 2024
1 parent c2d1a15 commit 63527e8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
1 change: 1 addition & 0 deletions CustomTagImporter/Common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ sub exitScan {
main::INFOLOG && $log->is_info && $log->info('Rescan completed (with errors) after '.(time()-($scanningContext->{'scanStartTime'})).' seconds.');
} else {
$prefs->set('scanResult', 1);
Slim::Control::Request::notifyFromArray(undef, ['customtagimporter', 'changedstatus', 1]) unless $scanningContext->{'importerCall'};
main::INFOLOG && $log->is_info && $log->info('Rescan completed after '.(time()-($scanningContext->{'scanStartTime'})).' seconds.');
}

Expand Down
33 changes: 20 additions & 13 deletions CustomTagImporter/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ sub initPlugin {

initPrefs();
Slim::Control::Request::subscribe(\&_setRefreshCBTimer, [['rescan'], ['done']]);
Slim::Control::Request::addDispatch(['customtagimporter', 'changedstatus','_status'],[0, 0, 0, undef]);

if (main::WEBUI) {
require Plugins::CustomTagImporter::Settings::Basic;
Expand Down Expand Up @@ -93,36 +94,42 @@ sub initPrefs {
}, 'customtagconfigmatrix');
}

sub getCustomBrowseMenusTemplates {
return getCustomBrowseTemplates(@_);
}

sub getCustomBrowseTemplates {
my $client = shift;
my $pluginVersion = shift;

my ($client, $pluginVersion) = @_;
my $CBversion = Slim::Utils::PluginManager->isEnabled('Plugins::CustomBrowseMenus::Plugin') ? 'CustomBrowseMenus' : 'CustomBrowse';
return Plugins::CustomTagImporter::CBTemplateReader::getTemplates($client, 'CustomTagImporter', $pluginVersion, 'PluginCache/'.$CBversion, 'CBMenuTemplates', 'xml');
}

sub getCustomBrowseTemplateData {
my $client = shift;
my $templateItem = shift;
my $parameterValues = shift;
sub getCustomBrowseMenusTemplateData {
return getCustomBrowseTemplateData(@_);
}

sub getCustomBrowseTemplateData {
my ($client, $templateItem, $parameterValues) = @_;
my $data = Plugins::CustomTagImporter::CBTemplateReader::readTemplateData('CustomTagImporter', 'CBMenuTemplates', $templateItem->{'id'});
return $data;
}

sub getCustomBrowseMenusContextTemplates {
return getCustomBrowseContextTemplates(@_);
}

sub getCustomBrowseContextTemplates {
my $client = shift;
my $pluginVersion = shift;
my ($client, $pluginVersion) = @_;
my $CBversion = Slim::Utils::PluginManager->isEnabled('Plugins::CustomBrowseMenus::Plugin') ? 'CustomBrowseMenus' : 'CustomBrowse';
return Plugins::CustomTagImporter::CBTemplateReader::getTemplates($client, 'CustomTagImporter', $pluginVersion, 'PluginCache/'.$CBversion, 'CBContextMenuTemplates', 'xml');
}

sub getCustomBrowseContextTemplateData {
my $client = shift;
my $templateItem = shift;
my $parameterValues = shift;
sub getCustomBrowseMenusContextTemplateData {
return getCustomBrowseContextTemplateData(@_);
}

sub getCustomBrowseContextTemplateData {
my ($client, $templateItem, $parameterValues) = @_;
my $data = Plugins::CustomTagImporter::CBTemplateReader::readTemplateData('CustomTagImporter', 'CBContextMenuTemplates', $templateItem->{'id'});
return $data;
}
Expand Down
2 changes: 1 addition & 1 deletion CustomTagImporter/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>afac7b8e-07fd-7c77-b8af-e6e996e8c140</id>
<name>PLUGIN_CUSTOMTAGIMPORTER</name>
<module>Plugins::CustomTagImporter::Plugin</module>
<version>1.2.3</version>
<version>1.2.4</version>
<description>PLUGIN_CUSTOMTAGIMPORTER_DESC</description>
<creator>AF</creator>
<importmodule>Plugins::CustomTagImporter::Importer</importmodule>
Expand Down

0 comments on commit 63527e8

Please # to comment.