1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 09:49:30 +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);
$results = $art->gather($options, 1, true);
$results = $art->gather($options, 1);
if (count($results)) {
// Pull the string representation from the source
@ -873,10 +873,7 @@ abstract class Catalog extends database_object
Video::generate_preview($id);
}
// Stupid little cutesie thing
$search_count++;
if (UI::check_ticker()) {
UI::update_text('count_art_' . $this->id, $search_count);
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 ($values as $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()
{
return $this->f_name;
return $this->name;
}
public function get_parent()

View file

@ -478,7 +478,7 @@ class Playlist extends playlist_object
foreach ($results as $data) {
$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
return true;

View file

@ -345,7 +345,7 @@ class TVShow extends database_object implements library_item
if ($override_childs) {
$episodes = $this->get_episodes();
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,24 +857,21 @@ class vainfo
// Pull out our actual matches
preg_match($pattern, $filename, $matches);
// The first element is the full match text
$matched = array_shift($matches);
debug_event('vainfo', $pattern . ' matched ' . $matched . ' on ' . $filename, 5);
if ($matches != null) {
// The first element is the full match text
$matched = array_shift($matches);
debug_event('vainfo', $pattern . ' matched ' . $matched . ' on ' . $filename, 5);
// Iterate over what we found
foreach ($matches as $key => $value) {
$new_key = translate_pattern_code($elements['0'][$key]);
if ($new_key) {
$results[$new_key] = $value;
}
// Iterate over what we found
foreach ($matches as $key => $value) {
$new_key = translate_pattern_code($elements['0'][$key]);
if ($new_key) {
$results[$new_key] = $value;
}
}
$results['title'] = $results['title'] ?: basename($filename);
if ($this->islocal) {
$results['size'] = filesize(Core::conv_lc_file($origin));
}
$results['title'] = $results['title'] ?: basename($filename);
if ($this->islocal) {
$results['size'] = filesize(Core::conv_lc_file($origin));
}
}

View file

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