Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion gmusicbrowser.pl
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ sub Load_Wnck
}
use List::Util qw/min max sum first/;
use File::Copy;
use Digest::MD5 ();
use Fcntl qw/O_NONBLOCK O_WRONLY O_RDWR SEEK_SET/;
use Scalar::Util qw/blessed weaken refaddr/;
use Unicode::Normalize 'NFKD'; #for accent-insensitive sort and search, only used via superlc()
Expand Down Expand Up @@ -9640,6 +9641,7 @@ package GMB::Picture;
our @ArraysOfFiles; #array of filenames that needs updating in case a folder is renamed

our $loaded_poppler;
my $DiskCacheDir;
sub pdf_ok
{ return $loaded_poppler if defined $loaded_poppler;
$loaded_poppler= eval {Glib::Object::Introspection->setup( basename => 'Poppler', version => '0.18', package => 'Poppler'); 1; } || 0;
Expand All @@ -9655,13 +9657,60 @@ sub pixbuf
{ my ($file,$size,$cacheonly,$anim_ok)=@_;
my $key= defined $size ? $size.':'.$file : $file;
my $pb= GMB::Cache::get($key);
if (!$pb && defined $size && !$anim_ok)
{ $pb= diskcache_get($file,$size);
GMB::Cache::add_pb($key,$pb) if $pb;
}
unless ($pb || $cacheonly)
{ $pb=load($file,size=>$size,anim_ok=>$anim_ok);
GMB::Cache::add_pb($key,$pb) if $pb && $pb->isa('Gtk3::Gdk::Pixbuf'); #don't bother caching animation
if ($pb && $pb->isa('Gtk3::Gdk::Pixbuf'))
{ GMB::Cache::add_pb($key,$pb); #don't bother caching animation
diskcache_add($file,$size,$pb) if defined $size;
}
}
return $pb;
}

sub diskcache_dir
{ return $DiskCacheDir if defined $DiskCacheDir;
$DiskCacheDir= $::HomeDir.'thumbnails';
unless (-d $DiskCacheDir)
{ my $ok= eval { ::CreateDir($DiskCacheDir); };
return $DiskCacheDir=undef unless $ok;
}
return $DiskCacheDir;
}

sub diskcache_file
{ my ($file,$size)=@_;
return unless defined $size && $size>0;
my $nb= $file=~s/:(\w+)$// ? $1 : '';
my @stat= stat $file;
return unless @stat;
my $key= join "\0",'v1',$size,$file,$nb,$stat[7],$stat[9];
my $dir= diskcache_dir();
return unless $dir;
return $dir.::SLASH.Digest::MD5::md5_hex($key).'.png';
}

sub diskcache_get
{ my ($file,$size)=@_;
my $cachefile= diskcache_file($file,$size);
return unless $cachefile && -e $cachefile;
my $pb= eval { Gtk3::Gdk::Pixbuf->new_from_file($cachefile); };
return $pb if $pb;
unlink $cachefile;
return;
}

sub diskcache_add
{ my ($file,$size,$pb)=@_;
my $cachefile= diskcache_file($file,$size);
return unless $cachefile;
eval { $pb->save($cachefile,'png'); };
unlink $cachefile if $@;
}

sub pdf_pages
{ my $file= shift;
my $ref= GMB::Cache::get("$file:pagecount");
Expand Down
Binary file added pix/elementary-dark/gmb-album.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-case_insensitive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-case_sensitive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-equalizer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-invert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-lock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-locklight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-lockopen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-picture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-playlist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-queue9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-random.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/elementary-dark/gmb-shuffle.png
Binary file added pix/elementary-dark/gmb-song.png
Binary file added pix/elementary-dark/gmb-turnoff.png
Binary file added pix/elementary-dark/gmb-view-fullscreen.png
Binary file added pix/elementary-dark/gmb-vol0.png
Binary file added pix/elementary-dark/gmb-vol1.png
Binary file added pix/elementary-dark/gmb-vol2.png
Binary file added pix/elementary-dark/gmb-vol3.png
Binary file added pix/elementary-dark/gmb-volm.png
Binary file added pix/elementary-dark/gmb-wait.png
Binary file added pix/elementary-dark/gtk-clear.png
Binary file added pix/elementary-dark/gtk-find.png
Binary file added pix/elementary-dark/gtk-fullscreen.png
Binary file added pix/elementary-dark/gtk-media-next.png
Binary file added pix/elementary-dark/gtk-media-pause.png
Binary file added pix/elementary-dark/gtk-media-play.png
Binary file added pix/elementary-dark/gtk-media-previous.png
Binary file added pix/elementary-dark/gtk-media-stop.png
Binary file added pix/elementary-dark/gtk-preferences.png
Binary file added pix/elementary-dark/gtk-quit.png
Binary file added pix/elementary-dark/gtk-sort-ascending.png
Binary file added pix/elementary-dark/gtk-sort-descending.png
4 changes: 4 additions & 0 deletions pix/elementary-dark/icon_source
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Source for the weblinks-icons
http://www.iconspedia.com/icon/last-fm-13861.html
author: http://umar123.deviantart.com/
License: Creative Commons Attribution-Noncommercial-No Derivative Works 3.0
142 changes: 142 additions & 0 deletions pix/elementary-dark/no-cover.svg
Binary file added pix/elementary-dark/overlay.png
Binary file added pix/elementary-dark/plugin-rip.png
Binary file added pix/elementary-dark/plugin-wikipedia.png
Binary file added pix/elementary-dark/stars0.png
Binary file added pix/elementary-dark/stars1.png
Binary file added pix/elementary-dark/stars10.png
Binary file added pix/elementary-dark/stars2.png
Binary file added pix/elementary-dark/stars3.png
Binary file added pix/elementary-dark/stars4.png
Binary file added pix/elementary-dark/stars5.png
Binary file added pix/elementary-dark/stars6.png
Binary file added pix/elementary-dark/stars7.png
Binary file added pix/elementary-dark/stars8.png
Binary file added pix/elementary-dark/stars9.png
Binary file added pix/elementary-dark/trayicon.png
Binary file added pix/elementary-dark/trayicon_dark.png