public function getUri(API $api) { return $api->linkToRoute('music_artist', array('artistIdOrSlug' => $this->id)); }
public function toAPI(API $api) { $coverUrl = null; if ($this->getCoverFileId() > 0) { $coverUrl = $api->linkToRoute('music_album_cover', array('albumIdOrSlug' => $this->getId())); } return array('name' => $this->getNameString($api), 'year' => $this->getYear(), 'cover' => $coverUrl, 'uri' => $this->getUri($api), 'slug' => $this->getid() . '-' . $this->slugify('name'), 'id' => $this->getId(), 'artists' => $this->getArtists($api)); }
public function toCollection(API $api) { return array('title' => $this->getTitle(), 'number' => $this->getNumber(), 'artistId' => $this->getArtistId(), 'albumId' => $this->getAlbumId(), 'files' => array($this->getMimetype() => $api->linkToRoute('music_file_download', array('fileId' => $this->getFileId()))), 'id' => $this->getId()); }
* version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ namespace OCA\Music; use OCA\Music\Core\API; $api = new API('music'); $api->addNavigationEntry(array('id' => $api->getAppName(), 'order' => 10, 'href' => $api->linkToRoute('music_index'), 'icon' => $api->imagePath('music.svg', 'music'), 'name' => $api->getTrans()->t('Music'))); $api->connectHook(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, 'OCA\\Music\\Utility\\HookHandler', 'fileUpdated'); $api->connectHook(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_delete, 'OCA\\Music\\Utility\\HookHandler', 'fileDeleted'); $api->connectHook('OCP\\Share', 'post_unshare', 'OCA\\Music\\Utility\\HookHandler', 'itemUnshared'); $api->connectHook('OCP\\Share', 'post_shared', 'OCA\\Music\\Utility\\HookHandler', 'itemShared'); $api->addRegularTask('OCA\\Music\\Backgroundjob\\CleanUp', 'run'); // load fileactions $api->addScript('public/fileactions'); if (version_compare(join('.', $api->getVersion()), '6.0.3', '<')) { $api->addScript('public/stable5-fixes'); } // load file for public sharing page $api->addScript('public/musicFilePlayer'); // register search provider \OC_Search::registerProvider('OCA\\Music\\Utility\\Search'); // register settings