Skip to content

Commit

Permalink
1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello committed Sep 21, 2021
1 parent 7f308f1 commit 85ae86c
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 81 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog
All notable changes to the Audio Player SONOS project will be documented in this file.

## 1.3.0 - 2021-09-21
### Changed
- more NC compatibility
- updated event listener
- new notifications

## 1.2.0 - 2020-10-04
### Added
- NC 20
Expand Down
21 changes: 0 additions & 21 deletions appinfo/app.php

This file was deleted.

9 changes: 4 additions & 5 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
<id>audioplayer_sonos</id>
<name>Audio Player - SONOS (add-on)</name>
<summary>SONOS Playback</summary>
<description><![CDATA[SONOS Playback add-on for the Audio Player in Nextcloud and ownCloud.
Audio Player as of v2.8 required
<description><![CDATA[SONOS Playback add-on for the Audio Player in Nextcloud.
- Play your local library on your SONOS speaker
]]></description>
<version>1.2.1</version>
<version>1.3.0</version>
<licence>agpl</licence>
<author>Marcel Scherello</author>
<namespace>audioplayer_sonos</namespace>
Expand All @@ -22,8 +21,8 @@
<discussion>https://help.nextcloud.com/c/apps/audioplayer</discussion>
<screenshot>https://raw.githubusercontent.com/rello/audioplayer_sonos/master/screenshots/audioplayer_sonos_logo.png</screenshot>
<dependencies>
<php min-version="7.0" max-version="7.4"/>
<nextcloud min-version="19" max-version="21"/>
<php min-version="7.0" max-version="8.0"/>
<nextcloud min-version="21" max-version="23"/>
</dependencies>
<types>
<filesystem/>
Expand Down
10 changes: 4 additions & 6 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
* @copyright 2019 Marcel Scherello
*/

namespace OCA\audioplayer_sonos\AppInfo;

$application = new Application();

$application->registerRoutes($this, ['routes' => [
return [
'routes' => [
['name' => 'setting#setValue', 'url' => '/setvalue', 'verb' => 'POST'],
['name' => 'setting#getValue', 'url' => '/getvalue', 'verb' => 'POST'],
['name' => 'setting#admin', 'url' => '/admin', 'verb' => 'POST'],
Expand All @@ -22,4 +19,5 @@
['name' => 'sonos#setAction', 'url' => '/sonosaction', 'verb' => 'POST'],
['name' => 'sonos#getDebugInfo', 'url' => '/sonosdebug', 'verb' => 'GET'],
['name' => 'sonos#getDeviceList', 'url' => '/sonosdevices', 'verb' => 'POST'],
]]);
]
];
2 changes: 1 addition & 1 deletion js/settings/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ document.addEventListener('DOMContentLoaded', function () {
'value': user_value
},
success: function () {
OC.Notification.showTemporary(t('audioplayer_sonos', 'saved'));
OCP.Toast.success(t('audioplayer_sonos', 'saved'))
}
});
});
Expand Down
6 changes: 3 additions & 3 deletions js/settings/personal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ document.addEventListener('DOMContentLoaded', function () {
'value': user_value
},
success: function () {
OC.Notification.showTemporary(t('audioplayer_sonos', 'saved'));
OCP.Toast.success(t('audioplayer_sonos', 'saved'))
}
});
});
Expand All @@ -43,7 +43,7 @@ document.addEventListener('DOMContentLoaded', function () {
'value': user_value
},
success: function () {
OC.Notification.showTemporary(t('audioplayer_sonos', 'saved'));
OCP.Toast.success(t('audioplayer_sonos', 'saved'))
}
});
});
Expand All @@ -58,7 +58,7 @@ document.addEventListener('DOMContentLoaded', function () {
'value': user_value
},
success: function () {
OC.Notification.showTemporary(t('audioplayer_sonos', 'saved'));
OCP.Toast.success(t('audioplayer_sonos', 'saved'))
}
});
});
Expand Down
25 changes: 20 additions & 5 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@

namespace OCA\audioplayer_sonos\AppInfo;

use OCA\audioplayer\Event\LoadAdditionalScriptsEvent;
use OCA\audioplayer_sonos\Listener\LoadAdditionalScripts;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;

class Application extends App {
class Application extends App implements IBootstrap
{
public const APP_ID = 'audioplayer_sonos';

public function __construct(array $urlParams = array()) {
public function __construct(array $urlParams = [])
{
parent::__construct(self::APP_ID, $urlParams);
}

parent::__construct('audioplayer_sonos', $urlParams);
public function register(IRegistrationContext $context): void
{
$context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class);
}

}
}
public function boot(IBootContext $context): void
{
}
}
18 changes: 3 additions & 15 deletions lib/Controller/DbController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,29 @@
use OCP\AppFramework\Controller;
use OCP\IRequest;
use OCP\IL10N;
use OCP\IDbConnection;
use OCP\Share\IManager;
use OCP\ILogger;
use OCP\ITagManager;

use OCP\IDBConnection;
use Psr\Log\LoggerInterface;
/**
* Controller class for main page.
*/
class DbController extends Controller
{

private $userId;
private $l10n;
private $db;
private $shareManager;
private $tagManager;
private $logger;

public function __construct(
$appName,
IRequest $request,
$userId,
IL10N $l10n,
IDbConnection $db,
ITagManager $tagManager,
IManager $shareManager,
ILogger $logger
LoggerInterface $logger
)
{
parent::__construct($appName, $request);
$this->userId = $userId;
$this->l10n = $l10n;
$this->db = $db;
$this->shareManager = $shareManager;
$this->tagManager = $tagManager;
$this->logger = $logger;
}

Expand Down
24 changes: 1 addition & 23 deletions lib/Controller/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\IConfig;
use OCP\Files\IRootFolder;
use OCP\ITagManager;
use OCP\IDbConnection;
use OCP\ISession;


/**
* Controller class for main page.
Expand All @@ -28,35 +23,18 @@ class SettingController extends Controller {

private $userId;
private $config;
private $rootFolder;
private $tagger;
private $tagManager;
private $db;
private $session;
private $DBController;

public function __construct(
$appName,
IRequest $request,
$userId,
IConfig $config,
IDBConnection $db,
ITagManager $tagManager,
IRootFolder $rootFolder,
ISession $session,
DbController $DBController
IConfig $config
)
{
parent::__construct($appName, $request);
$this->appName = $appName;
$this->userId = $userId;
$this->config = $config;
$this->db = $db;
$this->tagManager = $tagManager;
$this->tagger = null;
$this->rootFolder = $rootFolder;
$this->session = $session;
$this->DBController = $DBController;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/SonosController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use OCP\AppFramework\Http\JSONResponse;
use OCP\Files\IRootFolder;
use OCP\IConfig;
use OCP\ILogger;
use Psr\Log\LoggerInterface;
use OCP\IRequest;

/**
Expand All @@ -41,7 +41,7 @@ public function __construct(
IRequest $request,
$userId,
IConfig $configManager,
ILogger $logger,
LoggerInterface $logger,
IRootFolder $rootFolder,
DbController $DBController
)
Expand Down
31 changes: 31 additions & 0 deletions lib/Listener/LoadAdditionalScripts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

/**
* Audio Player SONOS
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the LICENSE.md file.
*
* @author Marcel Scherello <audioplayer@scherello.de>
* @copyright 2019 Marcel Scherello
*/

namespace OCA\audioplayer_sonos\Listener;

use OCA\audioplayer\Event\LoadAdditionalScriptsEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Util;

class LoadAdditionalScripts implements IEventListener
{
public function handle(Event $event): void
{
if ($event instanceof LoadAdditionalScriptsEvent) {
Util::addScript('audioplayer_sonos', 'sonos');
Util::addStyle('audioplayer_sonos', 'sonos');
}
}
}

0 comments on commit 85ae86c

Please sign in to comment.