From 1ff16a6cf126d74c3de2ec9796d45428224c0647 Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 18 Apr 2006 23:45:21 +0000 Subject: 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/branches/branch-1_6@1203 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/site_reader_remote.php | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'admin/site_reader_remote.php') diff --git a/admin/site_reader_remote.php b/admin/site_reader_remote.php index 03ad7d45a..dd0038877 100644 --- a/admin/site_reader_remote.php +++ b/admin/site_reader_remote.php @@ -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 -- cgit v1.2.3