merge r1203 from branch-1_6 into trunk

bug 335: tn_ext, has_high and representative_ext are updated during file
synchronization and not metadata synchronization

git-svn-id: http://piwigo.org/svn/trunk@1204 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2006-04-18 23:46:53 +00:00
parent 8e4c71c4bd
commit 94c39903dc
6 changed files with 174 additions and 79 deletions
+25 -7
View File
@@ -35,16 +35,19 @@ var $listing_url;
var $site_dirs;
var $site_files;
var $insert_attributes;
var $update_attributes;
var $metadata_attributes;
function RemoteSiteReader($url, $listing_url)
{
$this->site_url = $url;
$this->insert_attributes = array(
'tn_ext', 'representative_ext', 'has_high'
'tn_ext',
);
$this->update_attributes = array(
'representative_ext', 'has_high', 'filesize', 'width', 'height'
'tn_ext', 'representative_ext', 'has_high',
);
$this->metadata_attributes = array(
'filesize', 'width', 'height'
);
if (!isset($listing_url))
@@ -85,8 +88,8 @@ function open()
return false;
}
$this->update_attributes = array_merge(
$this->update_attributes,
$this->metadata_attributes = array_merge(
$this->metadata_attributes,
explode(',', getAttribute($info_xml_element, 'metadata'))
);
@@ -154,13 +157,12 @@ function get_elements($path)
}
// returns the name of the attributes that are supported for
// update/synchronization according to listing.xml
// files update/synchronization
function get_update_attributes()
{
return $this->update_attributes;
}
// returns a hash of attributes (metadata+filesize+width,...) for file
function get_element_update_attributes($file)
{
return $this->get_element_attributes(
@@ -169,6 +171,22 @@ function get_element_update_attributes($file)
);
}
// returns the name of the attributes that are supported for
// metadata update/synchronization according to listing.xml
function get_metadata_attributes()
{
return $this->metadata_attributes;
}
// returns a hash of attributes (metadata+width,...) for file
function get_element_metadata($file)
{
return $this->get_element_attributes(
$file,
$this->metadata_attributes
);
}
//-------------------------------------------------- private functions --------
/**
* Returns a hash of image/file attributes