From b1721ea5cdcf95258147229cf6ddd1c9463bf914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 26 Aug 2014 06:05:10 +0200 Subject: patches for some plugins --- debian/patches/05-keywords_desktop.patch | 15 ++ debian/patches/10-remove-system-calls.patch | 22 +++ debian/patches/11-fix_gamespot_plugin.patch | 281 ++++++++++++++++++++++++++++ debian/patches/12-fix_gamespot_images.patch | 20 ++ debian/patches/13-fix_musicbrainz.patch | 25 +++ debian/patches/14-fix_imdb.patch | 45 +++++ debian/patches/16-fix_isbndb_plugin.patch | 252 +++++++++++++++++++++++++ debian/patches/series | 7 + 8 files changed, 667 insertions(+) create mode 100644 debian/patches/05-keywords_desktop.patch create mode 100644 debian/patches/10-remove-system-calls.patch create mode 100644 debian/patches/11-fix_gamespot_plugin.patch create mode 100644 debian/patches/12-fix_gamespot_images.patch create mode 100644 debian/patches/13-fix_musicbrainz.patch create mode 100644 debian/patches/14-fix_imdb.patch create mode 100644 debian/patches/16-fix_isbndb_plugin.patch (limited to 'debian/patches') diff --git a/debian/patches/05-keywords_desktop.patch b/debian/patches/05-keywords_desktop.patch new file mode 100644 index 0000000..16131cc --- /dev/null +++ b/debian/patches/05-keywords_desktop.patch @@ -0,0 +1,15 @@ +Description: Add _Keywords to .desktop file +Author: Jörg Frings-Fürst +Forwarded: not-needed +Last-Update: 2014-08-21 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/share/applications/gcstar.desktop +=================================================================== +--- trunk.orig/share/applications/gcstar.desktop 2014-08-21 00:41:08.769531779 +0200 ++++ trunk/share/applications/gcstar.desktop 2014-08-21 00:41:19.817694292 +0200 +@@ -16,3 +16,4 @@ + Type=Application + Categories=Office; + MimeType=application/x-gcstar ++Keywords=collection;movies;games;books;music; diff --git a/debian/patches/10-remove-system-calls.patch b/debian/patches/10-remove-system-calls.patch new file mode 100644 index 0000000..99e67dc --- /dev/null +++ b/debian/patches/10-remove-system-calls.patch @@ -0,0 +1,22 @@ +Description: Remove useless system calls at install + Remove update-desktop-database & update-mime-database from upstream install +Author: Jörg Frings-Fürst +Forwarded: not-needed +Last-Update: 2014-08-21 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/install +=================================================================== +--- trunk.orig/install 2014-08-21 06:08:40.813186136 +0200 ++++ trunk/install 2014-08-21 06:09:04.117649411 +0200 +@@ -228,8 +228,8 @@ + copy 'share/applications/gcstar.xml', '/usr/share/mime/packages' + if (-w '/usr/share/mime/packages'); + +- system 'update-desktop-database'; +- system 'update-mime-database /usr/share/mime'; ++# system 'update-desktop-database'; ++# system 'update-mime-database /usr/share/mime'; + + + } diff --git a/debian/patches/11-fix_gamespot_plugin.patch b/debian/patches/11-fix_gamespot_plugin.patch new file mode 100644 index 0000000..a5827eb --- /dev/null +++ b/debian/patches/11-fix_gamespot_plugin.patch @@ -0,0 +1,281 @@ +Description: fix GameSpot games plugin +Origin: upstream, http://svn.gna.org/viewcvs/gcstar?view=revision&revision=2241 + +Caution: this patch contains CRLF terminators, +be careful when editing. + +Index: gcstar-1.7.0/lib/gcstar/GCPlugins/GCgames/GCGameSpot.pm +=================================================================== +--- gcstar-1.7.0.orig/lib/gcstar/GCPlugins/GCgames/GCGameSpot.pm 2011-11-26 05:46:14.000000000 -0500 ++++ gcstar-1.7.0/lib/gcstar/GCPlugins/GCgames/GCGameSpot.pm 2013-08-07 16:51:39.584461692 -0400 +@@ -2,7 +2,7 @@ + + ################################################### + # +-# Copyright 2005-2011 Christian Jodar ++# Copyright 2005-2013 Christian Jodar + # + # This file is part of GCstar. + # +@@ -40,21 +40,30 @@ + $self->{inside}->{$tagname}++; + if ($self->{parsingList}) + { +- if ($tagname eq 'div') ++ if (($tagname eq 'div') && ($attr->{class} eq 'result_title')) + { +- $self->{isGame} = 1 +- if $attr->{class} =~ /result_title/; ++ $self->{isGame} = 1; + } +- elsif ($tagname eq 'tpfdatetpf') +- { +- $self->{isDate} = 1; +- } +- elsif (($tagname eq 'a') && ($self->{isGame})) ++ elsif (($tagname eq 'a') && ($self->{isGame}) && ($self->{isName} eq 0)) + { + $self->{itemIdx}++; + $self->{itemsList}[$self->{itemIdx}]->{url} = $attr->{href}; + $self->{isName} = 1; + } ++ elsif (($tagname eq 'span') && ($attr->{class} eq 'release')) ++ { ++ $self->{isDate} = 1; ++ } ++ elsif (($tagname eq 'span') && ($attr->{class} eq 'platforms')) ++ { ++ $self->{isPlatform} = 1; ++ } ++ elsif (($tagname eq 'div') && ($attr->{class} eq 'clear') && ($self->{isGame})) ++ { ++ $self->{isGame} = 0; ++ $self->{isEnd} = 1; ++ $self->{isName} = 0; ++ } + } + elsif ($self->{parsingTips}) + { +@@ -97,17 +106,29 @@ + { + $self->{curInfo}->{boxpic} = $attr->{src}; + } +- if ($attr->{src} =~ /thumb/) ++ if ($attr->{src} =~ /thumb([0-9])/) + { +- my $pic = $attr->{src}; +- $pic =~ s/thumb00([0-9])/screen00$1/; +- if ($1 && ($1 <= 2)) ++ if (! $self->{curInfo}->{screenshot1}) ++ { ++ $self->{curInfo}->{screenshot1} = $attr->{src}; ++ $self->{curInfo}->{screenshot1} =~ s|thumb|screen|; ++ } ++ elsif (! $self->{curInfo}->{screenshot2}) + { +- $self->{curInfo}->{'screenshot'.$1} = $pic +- if ! $self->{curInfo}->{'screenshot'.$1}; ++ $self->{curInfo}->{screenshot2} = $attr->{src}; ++ $self->{curInfo}->{screenshot2} =~ s|thumb|screen|; + } + } + } ++ elsif ($tagname eq 'tpffiltertpf') ++ { ++ my $found = index($attr->{activefilter},"'site':'"); ++ if ( $found >= 0 ) ++ { ++ $self->{curInfo}->{platform} = substr($attr->{activefilter}, $found +length('\'site\':\''),length($attr->{activefilter})- $found -length('\'site\':\'')); ++ $self->{curInfo}->{platform} = substr($self->{curInfo}->{platform}, 0,index($self->{curInfo}->{platform},"'")); ++ } ++ } + elsif (($tagname eq 'div') && ($attr->{class} eq 'boxshot')) + { + $self->{isBox} = 1; +@@ -116,6 +137,7 @@ + { + my $html = $self->loadPage($self->getItemUrl($attr->{href}), 0, 1); + my $found = index($html,"id=\"main_image\" src=\""); ++ my $found2 = index($html,"img=back"); + if ( $found >= 0 ) + { + $html = substr($html, $found +length('id="main_image" src="'),length($html)- $found -length('id="main_image" src="')); +@@ -126,8 +148,11 @@ + { + $self->{curInfo}->{boxpic} = $array[0]; + } +- $self->{curInfo}->{backpic} = $array[0]; +- $self->{curInfo}->{backpic} =~ s/_front/_back/; ++ if ( $found2 >= 0 ) ++ { ++ $self->{curInfo}->{backpic} = $array[0]; ++ $self->{curInfo}->{backpic} =~ s/_front/_back/; ++ } + } + $self->{isBox} = 0; + } +@@ -135,11 +160,11 @@ + { + $self->{isName} = 1 if ! $self->{curInfo}->{name}; + } +- elsif (($tagname eq 'meta') && ($attr->{name} eq 'description')) ++ elsif (($tagname eq 'meta') && ($attr->{property} eq 'og:description')) + { + $self->{curInfo}->{description} = $attr->{content}; + } +- elsif (($tagname eq 'li') && ($attr->{class} =~ /activeFilter/)) ++ elsif (($tagname eq 'div') && ($attr->{class} eq 'availPlats')) + { + $self->{curInfo}->{exclusive} = 0; + } +@@ -188,7 +213,7 @@ + { + $self->{isReleased} = 1; + } +- elsif (($tagname eq 'a') && ($self->{isReleased} eq 1)) ++ elsif (($tagname eq 'span') && ($attr->{class} eq 'data') && ($self->{isReleased} eq 1)) + { + $self->{isReleased} = 2; + } +@@ -204,14 +229,6 @@ + my ($self, $tagname) = @_; + + $self->{inside}->{$tagname}--; +- if ($self->{parsingList}) +- { +- $self->{isGame} = 0 +- if ($tagname eq 'div'); +- } +- elsif ($self->{parsingTips}) +- { +- } + } + + sub text +@@ -220,20 +237,53 @@ + + if ($self->{parsingList}) + { +- if ($self->{isName}) ++ if ($self->{isName} eq 1) + { +- $origtext =~ /^(.*?)\s*\((.*?)\)\s*$/; +- $self->{itemsList}[$self->{itemIdx}]->{name} = $1; +- $self->{itemsList}[$self->{itemIdx}]->{platform} = $2; +- $self->{itemsList}[$self->{itemIdx}]->{url} = $self->{itemsList}[$self->{itemIdx}]->{url} . 'tpfplatformtpf' . $self->{itemsList}[$self->{itemIdx}]->{platform}; +- $self->{isName} = 0; ++ $self->{itemsList}[$self->{itemIdx}]->{name} = $origtext; ++ $self->{isName} = 2; ++ } ++ elsif ($self->{isPlatform}) ++ { ++ $self->{itemsList}[$self->{itemIdx}]->{platform} = $origtext; ++ $self->{isPlatform} = 0; + } + elsif ($self->{isDate}) + { +- $origtext =~ /^\s*Release Date:\s*(.*?)\s*$/ms; +- $self->{itemsList}[$self->{itemIdx}]->{released} = $1; ++ $self->{itemsList}[$self->{itemIdx}]->{released} = $origtext; + $self->{isDate} = 0; + } ++ elsif ($self->{isEnd}) ++ { ++ my @array = split(/,/,$self->{itemsList}[$self->{itemIdx}]->{platform}); ++ my $element; ++ ++ my $SaveName = $self->{itemsList}[$self->{itemIdx}]->{name}; ++ my $SaveDate = $self->{itemsList}[$self->{itemIdx}]->{released}; ++ my $SaveUrl = $self->{itemsList}[$self->{itemIdx}]->{url}; ++ $self->{itemIdx}--; ++ ++ foreach $element (@array) ++ { ++ # Enleve les blancs en debut de chaine ++ $element =~ s/^\s+//; ++ # Enleve les blancs en fin de chaine ++ $element =~ s/\s+$//; ++ # Pb : pas les memes noms de console entre l'affichage et l'url du jeu ++ $element =~ s/X360/XBOX360/i; ++ $element =~ s/WIIU/WII-U/i; ++ $element =~ s/AND/android/i; ++ $element =~ s/WINM/windows-mobile/i; ++ $element =~ s/GC/gamecube/i; ++ $element =~ s/FDS/famicomds/i; ++ ++ $self->{itemIdx}++; ++ $self->{itemsList}[$self->{itemIdx}]->{name} = $SaveName; ++ $self->{itemsList}[$self->{itemIdx}]->{released} = $SaveDate; ++ $self->{itemsList}[$self->{itemIdx}]->{url} = $SaveUrl . 'platform/' . $element .'/'; ++ $self->{itemsList}[$self->{itemIdx}]->{platform} = $element; ++ } ++ $self->{isEnd} = 0; ++ } + } + elsif ($self->{parsingTips}) + { +@@ -298,7 +348,6 @@ + { + $origtext =~ s/\n//g; + $self->{curInfo}->{name} = $origtext; +- $self->{curInfo}->{platform} = $self->{url_plateforme}; + $self->{curInfo}->{exclusive} = 1; + $self->{isName} = 0; + } +@@ -360,6 +409,8 @@ + $self->{isName} = 0; + $self->{isGame} = 0; + $self->{isDate} = 0; ++ $self->{isPlatform} = 0; ++ $self->{isEnd} = 0; + $self->{isCheat} = 0; + $self->{isDesc} = 0; + $self->{isTip} = 0; +@@ -372,10 +423,7 @@ + $self->{isReleased} = 0; + $self->{isPlayers} = 0; + $self->{isBox} = 0; +- $self->{isExclu} = 0; +- $self->{url_plateforme} = ''; + $self->{urlTips} = ""; +- $self->{SaveUrl} = ""; + + return $self; + } +@@ -393,11 +441,12 @@ + } + elsif ($self->{parsingList}) + { +- $html =~ s|Release Date|Release Date|g; + } + else + { +- my $found = index($html,"Similar Games"); ++ $html =~ s|Filter activeFilter|">Games You May Like<"); + if ( $found >= 0 ) + { + $html = substr($html, 0, $found); +@@ -440,19 +489,14 @@ + my ($self, $word) = @_; + + #return 'http://www.gamespot.com/search.html?qs='.$word.'&sub=g&stype=11&type=11'; +- return 'http://www.gamespot.com/pages/search/solr_search_ajax.php?q='.$word.'&type=game&offset=0&tags_only=false&sort=false'; ++ #return 'http://www.gamespot.com/pages/search/solr_search_ajax.php?q='.$word.'&type=game&offset=0&tags_only=false&sort=false'; ++ return 'http://www.gamespot.com/search/?qs='.$word.'&filter=summary'; + #return 'http://www.gamespot.com/search.html?qs=' .$word. '&tag=masthead%3Bsearch'; + } + + sub getItemUrl + { + my ($self, $url) = @_; +- my $found = index($url,"tpfplatformtpf"); +- if ( $found >= 0 ) +- { +- $self->{url_plateforme} = substr($url, $found +length('tpfplatformtpf'),length($url)- $found -length('tpfplatformtpf')); +- $url = substr($url, 0,$found); +- } + + return 'http://www.gamespot.com' . $url + if $url !~ /gamespot\.com/; diff --git a/debian/patches/12-fix_gamespot_images.patch b/debian/patches/12-fix_gamespot_images.patch new file mode 100644 index 0000000..5cd7675 --- /dev/null +++ b/debian/patches/12-fix_gamespot_images.patch @@ -0,0 +1,20 @@ +Description: fix GameSport games plugin box image loading +Author: Marc Deslauriers +Forwarded: http://forums.gcstar.org/viewtopic.php?id=18073 + +Caution: this patch contains CRLF terminators, +be careful when editing. + +Index: gcstar-1.7.0/lib/gcstar/GCPlugins/GCgames/GCGameSpot.pm +=================================================================== +--- gcstar-1.7.0.orig/lib/gcstar/GCPlugins/GCgames/GCGameSpot.pm 2013-08-07 16:53:27.752460660 -0400 ++++ gcstar-1.7.0/lib/gcstar/GCPlugins/GCgames/GCGameSpot.pm 2013-08-07 20:19:30.932342756 -0400 +@@ -102,7 +102,7 @@ + { + $self->{curInfo}->{boxpic} = ' ' + if $attr->{src} =~ /no_preview/; +- if ((! $self->{curInfo}->{boxpic}) && ($attr->{src} =~ /[^xo]boxs[^c]/)) ++ if ((! $self->{curInfo}->{boxpic}) && ($attr->{src} =~ /\/box\//)) + { + $self->{curInfo}->{boxpic} = $attr->{src}; + } diff --git a/debian/patches/13-fix_musicbrainz.patch b/debian/patches/13-fix_musicbrainz.patch new file mode 100644 index 0000000..92593a8 --- /dev/null +++ b/debian/patches/13-fix_musicbrainz.patch @@ -0,0 +1,25 @@ +Description: Fix the musicbrainz plugin +Origin: upstream, http://forums.gcstar.org/viewtopic.php?id=3490 + +--- gcstar-1.7.0.orig/lib/gcstar/GCPlugins/GCmusics/GCMusicBrainz.pm ++++ gcstar-1.7.0/lib/gcstar/GCPlugins/GCmusics/GCMusicBrainz.pm +@@ -234,7 +234,7 @@ use GCPlugins::GCmusics::GCmusicsCommon; + my ($self, $word) = @_; + + my $key = ($self->{searchField} eq 'artist') ? 'artist' : 'title'; +- return "http://musicbrainz.org/ws/1/release/?type=xml&$key=$word"; ++ return "http://musicbrainz.org/ws/1/release/?fmt=xml&$key=$word"; + } + + sub getItemUrl +@@ -247,8 +247,8 @@ use GCPlugins::GCmusics::GCmusicsCommon; + sub changeUrl + { + my ($self, $url) = @_; +- $url =~ s|http://musicbrainz.org/album/(.*?)\.html|http://musicbrainz.org/ws/1/release/$1?type=xml&inc=artist+tracks+release-events+artist-rels+url-rels+ratings+labels+tags|; +- $url =~ s|http://musicbrainz.org/release/(.*?)\.html|http://musicbrainz.org/ws/1/release/$1?type=xml&inc=artist+tracks+release-events+artist-rels+url-rels+ratings+labels+tags|; ++ $url =~ s|http://musicbrainz.org/album/(.*?)\.html|http://musicbrainz.org/ws/1/release/$1?fmt=xml&inc=artist+tracks+release-events+artist-rels+url-rels+ratings+labels+tags|; ++ $url =~ s|http://musicbrainz.org/release/(.*?)\.html|http://musicbrainz.org/ws/1/release/$1?fmt=xml&inc=artist+tracks+release-events+artist-rels+url-rels+ratings+labels+tags|; + return $url; + } + diff --git a/debian/patches/14-fix_imdb.patch b/debian/patches/14-fix_imdb.patch new file mode 100644 index 0000000..1d7675b --- /dev/null +++ b/debian/patches/14-fix_imdb.patch @@ -0,0 +1,45 @@ +Description: Fix the IMDb plugin +Author: David Weinehall + +Index: gcstar-1.7.0/lib/gcstar/GCPlugins/GCfilms/GCImdb.pm +=================================================================== +--- gcstar-1.7.0.orig/lib/gcstar/GCPlugins/GCfilms/GCImdb.pm ++++ gcstar-1.7.0/lib/gcstar/GCPlugins/GCfilms/GCImdb.pm +@@ -103,7 +103,14 @@ use GCPlugins::GCfilms::GCfilmsCommon; + elsif ($attr->{class} eq "title-extra") + { + $self->{insideOriginalTitle} = 1; +- } ++ } ++ elsif ($self->{insideCastList}) ++ { ++ if ($attr->{class} eq 'itemprop' && $attr->{itemprop} eq 'name') ++ { ++ $self->{insideActor} = 1; ++ } ++ } + } + elsif ($tagname eq "img") + { +@@ -140,11 +147,7 @@ use GCPlugins::GCfilms::GCfilmsCommon; + { + if ($self->{insideCastList}) + { +- if ($attr->{class} eq 'name') +- { +- $self->{insideActor} = 1; +- } +- elsif ($attr->{class} eq 'character') ++ if ($attr->{class} eq 'character') + { + $self->{insideRole} = 1; + } +@@ -236,7 +239,7 @@ use GCPlugins::GCfilms::GCfilmsCommon; + + if ($self->{parsingList}) + { +- if ($self->{inside}->{h1} && $origtext !~ m/IMDb\s*Title\s*Search/i) ++ if ($self->{inside}->{title} && $origtext !~ m/Find\s-\sIMDb/i) + { + $self->{parsingEnded} = 1; + $self->{itemIdx} = 0; diff --git a/debian/patches/16-fix_isbndb_plugin.patch b/debian/patches/16-fix_isbndb_plugin.patch new file mode 100644 index 0000000..a845326 --- /dev/null +++ b/debian/patches/16-fix_isbndb_plugin.patch @@ -0,0 +1,252 @@ +Description: fix ISBNdb book plugin +Author: Marc Deslauriers +Forwarded: http://forums.gcstar.org/viewtopic.php?id=18072 + +Index: gcstar-1.7.0/lib/gcstar/GCPlugins/GCbooks/GCISBNdb.pm +=================================================================== +--- gcstar-1.7.0.orig/lib/gcstar/GCPlugins/GCbooks/GCISBNdb.pm 2011-07-17 08:23:00.000000000 -0400 ++++ gcstar-1.7.0/lib/gcstar/GCPlugins/GCbooks/GCISBNdb.pm 2013-08-07 16:47:41.752463960 -0400 +@@ -42,49 +42,51 @@ + if ($self->{parsingList}) + { + +- if (($tagname eq 'div') && ($attr->{class} eq 'bookInfo') && ($self->{searchField} ne 'isbn')) ++ if (($tagname eq 'div') && ($attr->{class} eq 'bookSnippetBasic')) + { + $self->{isBook} = 1 ; + } +- elsif (($tagname eq 'a') && ( index($attr->{href},"/d/book/") >= 0) && ($self->{isBook})) ++ elsif (($tagname eq 'a') && ( index($attr->{href},"/book/") >= 0) && ($self->{isBook})) + { + $self->{itemIdx}++; +- $self->{itemsList}[$self->{itemIdx}]->{url} = "http://isbndb.com" . $attr->{href}; ++ $self->{itemsList}[$self->{itemIdx}]->{url} = $attr->{href}; ++ } ++ elsif (($tagname eq 'h1') && ($self->{isBook})) ++ { + $self->{isTitle} = 1 ; + } +- elsif (($tagname eq 'a') && ( index($attr->{href},"/d/person/") >= 0) && ($self->{isBook})) ++ elsif (($tagname eq 'a') && ( index($attr->{href},"/author/") >= 0) && ($self->{isBook})) + { + $self->{isAuthor} = 1 ; + } +- elsif (($tagname eq 'a') && ( index($attr->{href},"/d/publisher/") >= 0) && ($self->{isBook})) ++ elsif (($tagname eq 'a') && ( index($attr->{href},"/publisher/") >= 0) && ($self->{isBook})) + { + $self->{isPublisher} = 1 ; + } +- elsif (($tagname eq 'a') && ( index($attr->{onclick},"isbndbTrackBuy") >= 0) && ($self->{itemIdx} eq '-1')) +- { +- $self->{itemIdx}++; +- $self->{itemsList}[$self->{itemIdx}]->{url} = $self->{loadedUrl} ; +- } +- elsif (($tagname eq 'span') && ($attr->{class} eq 'inactive')) ++ elsif ($tagname eq 'span') + { + $self->{isBook} = 0 ; + } + } + else + { +- if ($tagname eq 'title') ++ if (($tagname eq 'div') && ($attr->{class} eq 'bookSnippetBasic')) ++ { ++ $self->{isBook} = 1 ; ++ } ++ if (($tagname eq 'h1') && ($self->{isBook})) + { + $self->{isTitle} = 1 ; + } +- elsif (($tagname eq 'a') && ( index($attr->{href},"/d/person/") >= 0)) ++ elsif (($tagname eq 'a') && ( index($attr->{href},"/author/") >= 0)) + { + $self->{isAuthor} = 1 ; + } +- elsif (($tagname eq 'a') && ( index($attr->{href},"/d/publisher/") >= 0)) ++ elsif (($tagname eq 'a') && ( index($attr->{href},"/publisher/") >= 0)) + { + $self->{isPublisher} = 1 ; + } +- elsif (($tagname eq 'a') && ( index($attr->{href},"/c/Library_Shelves/Dewey") >= 0)) ++ elsif (($tagname eq 'a') && ( index($attr->{href},"/subject/") >= 0)) + { + $self->{isGenre} = 1 ; + } +@@ -104,6 +106,10 @@ + $self->{curInfo}->{cover} = $array[0]; + } + } ++ elsif (($tagname eq 'div') && ($attr->{id} eq 'rightColumn')) ++ { ++ $self->{isBook} = 0 ; ++ } + } + } + +@@ -127,14 +133,34 @@ + } + elsif ($self->{isAuthor}) + { ++ my @nom_prenom = split(/,/,$origtext); ++ # Enleve les blancs en debut de chaine ++ $nom_prenom[0] =~ s/^\s//; ++ $nom_prenom[1] =~ s/^\s//; ++ # Enleve les blancs en fin de chaine ++ $nom_prenom[0] =~ s/\s+$//; ++ $nom_prenom[1] =~ s/\s+$//; + if ($self->{itemsList}[$self->{itemIdx}]->{authors} eq '') + { +- $self->{itemsList}[$self->{itemIdx}]->{authors} = $origtext; ++ if ($nom_prenom[1] ne '') ++ { ++ $self->{itemsList}[$self->{itemIdx}]->{authors} = $nom_prenom[1] ." " . $nom_prenom[0]; ++ } ++ else ++ { ++ $self->{itemsList}[$self->{itemIdx}]->{authors} = $nom_prenom[0]; ++ } + } + else + { +- $self->{itemsList}[$self->{itemIdx}]->{authors} .= ', '; +- $self->{itemsList}[$self->{itemIdx}]->{authors} .= $origtext; ++ if ($nom_prenom[1] ne '') ++ { ++ $self->{itemsList}[$self->{itemIdx}]->{authors} .= ", " . $nom_prenom[1] ." " . $nom_prenom[0]; ++ } ++ else ++ { ++ $self->{itemsList}[$self->{itemIdx}]->{authors} .= ", " . $nom_prenom[0]; ++ } + } + $self->{isAuthor} = 0 ; + } +@@ -157,8 +183,35 @@ + } + elsif ($self->{isAuthor}) + { +- $self->{curInfo}->{authors} .= $origtext; +- $self->{curInfo}->{authors} .= ","; ++ my @nom_prenom = split(/,/,$origtext); ++ # Enleve les blancs en debut de chaine ++ $nom_prenom[0] =~ s/^\s//; ++ $nom_prenom[1] =~ s/^\s//; ++ # Enleve les blancs en fin de chaine ++ $nom_prenom[0] =~ s/\s+$//; ++ $nom_prenom[1] =~ s/\s+$//; ++ if ($self->{curInfo}->{authors} eq '') ++ { ++ if ($nom_prenom[1] ne '') ++ { ++ $self->{curInfo}->{authors} = $nom_prenom[1] ." " . $nom_prenom[0]; ++ } ++ else ++ { ++ $self->{curInfo}->{authors} = $nom_prenom[0]; ++ } ++ } ++ else ++ { ++ if ($nom_prenom[1] ne '') ++ { ++ $self->{curInfo}->{authors} .= ", " . $nom_prenom[1] ." " . $nom_prenom[0]; ++ } ++ else ++ { ++ $self->{curInfo}->{authors} .= ", " . $nom_prenom[0]; ++ } ++ } + $self->{isAuthor} = 0 ; + } + elsif ($self->{isPublisher}) +@@ -168,9 +221,9 @@ + } + elsif ($self->{isAnalyse}) + { +- $self->{isFormat} = 1 if ($origtext =~ m/Book Details:/i); +- $self->{isDescription} = 1 if ($origtext =~ m/Notes:/i); +- $self->{isDescription} = 1 if ($origtext =~ m/Summary:/i); ++ $self->{isFormat} = 1 if ($origtext =~ m/Book Details/i); ++ $self->{isDescription} = 1 if ($origtext =~ m/Notes/i); ++ $self->{isDescription} = 1 if ($origtext =~ m/Summary/i); + + $self->{isAnalyse} = 0 ; + } +@@ -233,14 +286,25 @@ + } + elsif ($self->{isGenre}) + { +- my @array = split(/--/,$origtext); ++ $origtext =~ s/ -- /\//gi; + +- $self->{curInfo}->{genre} = $array[1]; + # Enleve les blancs en debut de chaine +- $self->{curInfo}->{genre} =~ s/^\s+//; ++ $origtext =~ s/^\s+//; ++ # Enleve les blancs en fin de chaine ++ $origtext =~ s/\s+$//g; ++ ++ if ($self->{curInfo}->{genre} eq '') ++ { ++ $self->{curInfo}->{genre} = $origtext; ++ } ++ else ++ { ++ $self->{curInfo}->{genre} .= ", " . $origtext; ++ } + $self->{isGenre} = 0 ; + } +- elsif (($origtext =~ m/ISBN:/i) && ($self->{curInfo}->{isbn} eq '')) ++ elsif ((($origtext =~ m/ISBN10:/i) && ($self->{curInfo}->{isbn} eq '')) || ++ ($origtext =~ m/ISBN13:/i)) + { + my @array = split(/:/,$origtext); + +@@ -297,7 +361,10 @@ + else + { + $html =~ s|||gi; +- $html =~ s|
  • |\n* |gi; ++ $html =~ s|
  • ||gi; ++ $html =~ s|
  • ||gi; ++ $html =~ s|
      ||gi; ++ $html =~ s|
    ||gi; + $html =~ s|
    |\n|gi; + $html =~ s|
    |\n|gi; + $html =~ s|||gi; +@@ -312,7 +379,7 @@ + $html =~ s|…|...|gi; + $html =~ s|\x{8C}|OE|gi; + $html =~ s|\x{9C}|oe|gi; +- ++ $html =~ s|\x{94}|\n|gi; + } + + return $html; +@@ -321,14 +388,13 @@ + sub getSearchUrl + { + my ($self, $word) = @_; +- + if ($self->{searchField} eq 'isbn') + { +- return "http://isbndb.com/search-all.html?kw=" .$word; ++ return "http://isbndb.com/search/all?query=" .$word; + } + else + { +- return "http://isbndb.com/search-title.html?kw=" .$word ."&isn="; ++ return "http://isbndb.com/search/books/1?query=" .$word; + } + + } +@@ -348,7 +414,7 @@ + sub getCharset + { + my $self = shift; +- return "ISO-8859-15"; ++ return "UTF-8"; + } + + sub getAuthor diff --git a/debian/patches/series b/debian/patches/series index fb2a3fe..2d4e539 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,9 @@ +10-remove-system-calls.patch +05-keywords_desktop.patch 01_set_usr_lib.patch 03_change_default_browser.patch +11-fix_gamespot_plugin.patch +12-fix_gamespot_images.patch +13-fix_musicbrainz.patch +14-fix_imdb.patch +16-fix_isbndb_plugin.patch \ No newline at end of file -- cgit v1.2.3