1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 17:59:21 +02:00

Fix latest Scrutinizer reported errors

This commit is contained in:
Afterster 2014-07-10 07:25:15 +02:00
parent 80cd08ed04
commit 504013ae66
6 changed files with 24 additions and 23 deletions

View file

@ -846,7 +846,7 @@ abstract class Catalog extends database_object
} }
$art = new Art($id, $type); $art = new Art($id, $type);
$results = $art->gather($options, 1, true); $results = $art->gather($options, 1);
if (count($results)) { if (count($results)) {
// Pull the string representation from the source // Pull the string representation from the source
@ -873,10 +873,7 @@ abstract class Catalog extends database_object
Video::generate_preview($id); Video::generate_preview($id);
} }
// Stupid little cutesie thing
$search_count++;
if (UI::check_ticker()) { if (UI::check_ticker()) {
UI::update_text('count_art_' . $this->id, $search_count);
UI::update_text('read_art_' . $this->id, $libitem->get_fullname()); UI::update_text('read_art_' . $this->id, $libitem->get_fullname());
} }
} }
@ -930,6 +927,12 @@ abstract class Catalog extends database_object
foreach ($searches as $key => $values) { foreach ($searches as $key => $values) {
foreach ($values as $id) { foreach ($values as $id) {
$this->gather_art_item($key, $id); $this->gather_art_item($key, $id);
// Stupid little cutesie thing
$search_count++;
if (UI::check_ticker()) {
UI::update_text('count_art_' . $this->id, $search_count);
}
} }
} }

View file

@ -83,7 +83,7 @@ class Live_Stream extends database_object implements media, library_item
public function get_fullname() public function get_fullname()
{ {
return $this->f_name; return $this->name;
} }
public function get_parent() public function get_parent()

View file

@ -478,7 +478,7 @@ class Playlist extends playlist_object
foreach ($results as $data) { foreach ($results as $data) {
$sql = "UPDATE `playlist_data` SET `track` = ? WHERE `id` = ?"; $sql = "UPDATE `playlist_data` SET `track` = ? WHERE `id` = ?";
$db_results = Dba::query($sql, array($data['track'], $data['id'])); Dba::write($sql, array($data['track'], $data['id']));
} // foreach re-ordered results } // foreach re-ordered results
return true; return true;

View file

@ -345,7 +345,7 @@ class TVShow extends database_object implements library_item
if ($override_childs) { if ($override_childs) {
$episodes = $this->get_episodes(); $episodes = $this->get_episodes();
foreach ($episodes as $ep_id) { foreach ($episodes as $ep_id) {
Tag::update_tag_list($data['edit_tags'], 'episode', $ep_id); Tag::update_tag_list($tags_comma, 'episode', $ep_id);
} }
} }
} }

View file

@ -857,8 +857,6 @@ class vainfo
// Pull out our actual matches // Pull out our actual matches
preg_match($pattern, $filename, $matches); preg_match($pattern, $filename, $matches);
if ($matches != null) {
// The first element is the full match text // The first element is the full match text
$matched = array_shift($matches); $matched = array_shift($matches);
debug_event('vainfo', $pattern . ' matched ' . $matched . ' on ' . $filename, 5); debug_event('vainfo', $pattern . ' matched ' . $matched . ' on ' . $filename, 5);
@ -876,7 +874,6 @@ class vainfo
$results['size'] = filesize(Core::conv_lc_file($origin)); $results['size'] = filesize(Core::conv_lc_file($origin));
} }
} }
}
if (in_array('tvshow', $this->gather_types)) { if (in_array('tvshow', $this->gather_types)) {
$pathinfo = pathinfo($filename); $pathinfo = pathinfo($filename);

View file

@ -86,13 +86,14 @@ $rootMediaItems[] = Upnp_Api::_videoMetadata('');
} }
$totMatches = count($items); $totMatches = count($items);
if ($totMatches == 0) { if ($items == null || $totMatches == 0) {
$domDIDL = Upnp_Api::createDIDL(''); $domDIDL = Upnp_Api::createDIDL('');
$numRet = 0; $numRet = 0;
} else { } else {
if ($upnpRequest['requestedcount'] == 0) { if ($upnpRequest['requestedcount'] == 0) {
$upnpRequest['requestedcount'] = $totMatches - $upnpRequest['startingindex']; $upnpRequest['requestedcount'] = $totMatches - $upnpRequest['startingindex'];
} }
$slicedItems = array_slice($items, $upnpRequest['startingindex'], $upnpRequest['requestedcount']); $slicedItems = array_slice($items, $upnpRequest['startingindex'], $upnpRequest['requestedcount']);
$domDIDL = Upnp_Api::createDIDL($slicedItems); $domDIDL = Upnp_Api::createDIDL($slicedItems);
$numRet = count($slicedItems); $numRet = count($slicedItems);