1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00

[BUGFIX] Fix some metadata errors

This commit is contained in:
René Bigler 2015-11-19 22:56:07 +01:00
parent 61de51ef93
commit e96b0ff073
5 changed files with 19 additions and 12 deletions

View file

@ -98,9 +98,9 @@ class Metadata extends \Lib\DatabaseObject implements \Lib\Interfaces\Model
/**
*
* @param \library_item $object
* @param integer $object
*/
public function setObjectId(\library_item $object)
public function setObjectId($object)
{
$this->objectId = $object;
}

View file

@ -23,6 +23,8 @@
namespace Lib;
use Lib\Interfaces\Model;
/**
* Description of Repository
*
@ -178,7 +180,7 @@ class Repository
* @param string $property
* @param mixed $value
*/
protected function setPrivateProperty(Object $object, $property, $value)
protected function setPrivateProperty(Model $object, $property, $value)
{
$reflectionClass = new \ReflectionClass(get_class($object));
$ReflectionProperty = $reflectionClass->getProperty($property);

View file

@ -2219,3 +2219,4 @@ abstract class Catalog extends database_object
}
// end of catalog class

View file

@ -853,6 +853,11 @@ class Song extends database_object implements media, library_item
// Foreach them
foreach ($fields as $key=>$value) {
// Skip the item if it is no string nor something we can turn into a string
if (!is_string($song->$key) || (is_object($song->$key) && method_exists($song->key, '__toString'))) {
continue;
}
$key = trim($key);
if (empty($key) || in_array($key,$skip_array)) {
continue;
@ -2031,3 +2036,4 @@ class Song extends database_object implements media, library_item
return $deleted;
}
} // end of song class