repository/picasa MDL-17473 Use picasa description as the filename if it exists

This commit is contained in:
moodler 2009-01-19 06:19:26 +00:00
parent 5d2ee15194
commit d44cee76fa
2 changed files with 12 additions and 4 deletions

View file

@ -432,14 +432,23 @@ class google_picasa {
//hacky...
$thumbnailinfo = $mediainfo->group->thumbnail[0]->attributes();
$files[] = array('title' => (string) $mediainfo->group->title,
// Derive the nicest file name we can
if (!empty($mediainfo->group->description)) {
$title = shorten_text((string)$mediainfo->group->description, 20, false, '');
$title = clean_filename($title).'.jpg';
} else {
$title = (string)$mediainfo->group->title;
}
$files[] = array(
'title' => $title,
'date' => userdate($gphoto->timestamp),
'size' => (int) $gphoto->size,
'path' => $gphoto->albumid.'/'.$gphoto->id,
'thumbnail' => (string) $thumbnailinfo['url'],
'thumbnail_width' => 72, // 72 is the native maximum dimension
'thumbnail_height' => 72,
'source' => (string) $fullinfo['url'],
'source' => (string) $fullinfo['url']
);
}