Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct arrays on nextcloud11 & php 7.1 #110

Merged
merged 2 commits into from
Dec 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 3rdparty/getid3/module.audio.mp3.php
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $S
// $info['warning'][] = 'Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)';
// }
} else {
if (! is_array($info['warning'])) $info['warning'] = array();
$info['warning'][] = 'Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)';
}
}
Expand Down
10 changes: 5 additions & 5 deletions controller/categorycontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getCategory(){
$playlists= $this->getCategoryforUser($category);

if(is_array($playlists)){
$aPlayLists='';
$aPlayLists= array();
foreach($playlists as $playinfo){
$aPlayLists[]=['info' => $playinfo, 'songids' => $this->getSongIdsForCategory($category,$playinfo['id'])];
}
Expand Down Expand Up @@ -127,18 +127,18 @@ private function getCategoryforUser($category){

$stmt =$this->db->prepareQuery($SQL);
$result = $stmt->execute(array($this->userId));
$aPlaylists='';
$aPlaylists=array();
while( $row = $result->fetchRow()) {
$bg = $this->genColorCodeFromText(trim($row['name']),40,8);
$row['backgroundColor']=$bg;
$row['color']=$this->generateTextColor($bg);
$aPlaylists[]=$row;
}

if(is_array($aPlaylists)){
return $aPlaylists;
}else{
if(empty($aPlaylists)){
return false;
}else{
return $aPlaylists;
}
}

Expand Down
8 changes: 4 additions & 4 deletions controller/musiccontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function loadSongs(){

$stmt = $this->db->prepareQuery($SQL);
$result = $stmt->execute(array($this->userId));
$aSongs='';
$aSongs=array();

while( $row = $result->fetchRow()) {
$file_not_found = false;
Expand All @@ -275,10 +275,10 @@ public function loadSongs(){
$this->deleteFromDB($row['id'],$row['album_id'],$row['artist_id'],$row['file_id']);
}
}
if(is_array($aSongs)){
return $aSongs;
}else{
if(empty($aSongs)){
return false;
}else{
return $aSongs;
}
}

Expand Down