Re: Swish-e PDF titles in search results

Peter Karman <[email protected]>
Newsgroups gmane.comp.web.swish-e
Message-ID <[email protected]>

Peter Karman scribbled on 7/13/06 9:54 AM:
> 
> Bill Moseley scribbled on 7/13/06 9:41 AM:
> 
>> Oh yes. I forgot that the pdf converter doesn't have a default for
>> the title.
>>
> 
> seems like it would be good for it to have a default for title. I'll see 
> about adding it -- unless someone beats me to it! :)
> 

how's this?

===================================================================
--- lib/SWISH/Filters/Pdf2HTML.pm       (revision 153)
+++ lib/SWISH/Filters/Pdf2HTML.pm       (working copy)
@@ -19,7 +19,9 @@
      my ( $self, $doc ) = @_;

      my $user_data = $doc->user_data;
-    my $title_tag = $user_data->{pdf}{title_tag} if ref $user_data eq 
'HASH';
+    my $title_tag = ref $user_data eq 'HASH'
+        ? $user_data->{pdf}{title_tag}
+        : 'title';

      my $file = $doc->fetch_filename;

-- 
Peter Karman  .  http://peknet.com/  .  [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.