Skip to content

Commit

Permalink
composer cs:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlan-00 committed Jan 30, 2024
1 parent 6cf324d commit b6da23d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/Module/Playback/Localplay/Vlc/AmpacheVlc.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ public function skip($song): bool
//vlc skip is based on his playlist track, we convert ampache localplay track to vlc
//playlist id
$listtracks = $this->get();
foreach( $listtracks as $track ) {
if( $track['id'] == $song ) {
foreach($listtracks as $track) {
if($track['id'] == $song) {
$songid = $track['vlid'];
break;
}
Expand Down Expand Up @@ -455,7 +455,7 @@ public function get(): array
$counter = 0;
// here we look if there are song in the playlist when media libary is used
if ($list['node']['node'][0]['leaf'][$counter]['attr']['uri']) {
while (array_key_exists( $counter, $list['node']['node'][0]['leaf'])) {
while (array_key_exists($counter, $list['node']['node'][0]['leaf'])) {
$songs[] = htmlspecialchars_decode(
$list['node']['node'][0]['leaf'][$counter]['attr']['uri'],
ENT_NOQUOTES
Expand Down Expand Up @@ -489,9 +489,9 @@ public function get(): array
$data = array();

/* Required Elements */
$data['id'] = $counter; // id follows localplay api
$data['id'] = $counter; // id follows localplay api
$data['vlid'] = $song_id[$counter]; // vlid number of the files in the VLC playlist, needed for other operations
$data['raw'] = $entry;
$data['raw'] = $entry;

$url_data = $this->parse_url($entry);
switch ($url_data['primary_key']) {
Expand Down Expand Up @@ -551,7 +551,7 @@ public function status(): array
$arrayholder = $this->_vlc->fullstate(); //get status.xml via parser xmltoarray
/* Construct the Array */
$currentstat = $arrayholder['root']['state']['value'];
$listtracks = $this->get();
$listtracks = $this->get();

if ($currentstat == 'playing') {
$state = 'play';
Expand All @@ -565,7 +565,7 @@ public function status(): array

$array = array();
$array['track'] = 0;
$oid = '';
$oid = '';

$array['track_title'] = '';
$array['track_artist'] = '';
Expand All @@ -582,25 +582,25 @@ public function status(): array
ENT_NOQUOTES
);
$url_data = $this->parse_url($ampurl);
$oid = array_key_exists( 'oid' , $url_data ) ? $url_data['oid'] : '';
$oid = array_key_exists('oid', $url_data) ? $url_data['oid'] : '';

foreach( $listtracks as $track ) {
if( $track['oid'] == $oid ) {
foreach($listtracks as $track) {
if($track['oid'] == $oid) {
$array['track'] = $track['track'];
break;
}
}
}

//api version 3
if(array_key_exists( 'currentplid' , $arrayholder['root'] ) ) {
if(array_key_exists('currentplid', $arrayholder['root'])) {
$numtrack = 0 ;
$numtrack = (int)$arrayholder['root']['currentplid']['value'];

foreach( $listtracks as $track ) {
if( $track['vlid'] == $numtrack ) {
foreach($listtracks as $track) {
if($track['vlid'] == $numtrack) {
$array['track'] = $track['track'];
$oid = $track['oid'];
$oid = $track['oid'];
break;
}
}
Expand Down

0 comments on commit b6da23d

Please sign in to comment.