From 4e380e6e3fb55cdb63e2399614184a85e4475e30 Mon Sep 17 00:00:00 2001 From: dakkar Date: Thu, 20 Oct 2005 13:41:27 +0000 Subject: ora gestisce le icone, ma devo tenerle in un TEXT, base64, causa bug in DBD::SQLite --- script/bookmarks_load.pl | 16 ++++++---------- script/bookmarks_makedb.pl | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'script') diff --git a/script/bookmarks_load.pl b/script/bookmarks_load.pl index 8535348..9862f87 100755 --- a/script/bookmarks_load.pl +++ b/script/bookmarks_load.pl @@ -14,8 +14,6 @@ my $links; $yaml = <>; $links=YAML::Load($yaml); } -my $icon=do {local $/;open my $fh,'<:raw','favicon.ico';<$fh>}; -print "Icon is $icon\n"; my %fields=( description => 'title', @@ -32,20 +30,18 @@ for my $link (@$links) { my $dblink=Bookmarks::M::DB::Links->find_or_create({ url => $link->{href}, }); -# if (!Bookmarks::Utils::check_link($link->{href})) { -# warn "Link $link->{href} non valido, marco come tale\n"; -# $link->{title}.=' [INVALID]'; -# } + if (!Bookmarks::Utils::check_link($link->{href})) { + warn "Link $link->{href} non valido, marco come tale\n"; + $link->{title}.=' [INVALID]'; + } $link->{created}||=time(); $link->{modified}||=time(); while (my ($f1,$f2) = each %fields) { $dblink->$f2($link->{$f1}); } -# $dblink->icon(Bookmarks::Utils::get_site_icon($link->{href})); - $dblink->icon($icon); - print 'Set icon to: ',$dblink->icon(),"\n"; + $dblink->set_icon(Bookmarks::Utils::get_site_icon($link->{href})); $dblink->update(); - print 'Set icon to: ',$dblink->icon(),"\n"; + for my $tagname (@{$link->{tags}}) { my $dbtag=Bookmarks::M::DB::Tags->find_or_create({ name => $tagname, diff --git a/script/bookmarks_makedb.pl b/script/bookmarks_makedb.pl index 93027a7..7b3ee1c 100644 --- a/script/bookmarks_makedb.pl +++ b/script/bookmarks_makedb.pl @@ -27,7 +27,7 @@ create table links ( url text unique, title text, descr text, - icon blob, + icon text, add_date integer, last_access_date integer, access_count integer -- cgit v1.2.3