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:
parent
80cd08ed04
commit
504013ae66
6 changed files with 24 additions and 23 deletions
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -857,24 +857,21 @@ class vainfo
|
||||||
|
|
||||||
// Pull out our actual matches
|
// Pull out our actual matches
|
||||||
preg_match($pattern, $filename, $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) {
|
// Iterate over what we found
|
||||||
// The first element is the full match text
|
foreach ($matches as $key => $value) {
|
||||||
$matched = array_shift($matches);
|
$new_key = translate_pattern_code($elements['0'][$key]);
|
||||||
debug_event('vainfo', $pattern . ' matched ' . $matched . ' on ' . $filename, 5);
|
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);
|
$results['title'] = $results['title'] ?: basename($filename);
|
||||||
if ($this->islocal) {
|
if ($this->islocal) {
|
||||||
$results['size'] = filesize(Core::conv_lc_file($origin));
|
$results['size'] = filesize(Core::conv_lc_file($origin));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue