[mythtv-users] mythtools v0.2

Mat Mrosko myth.mrosko at gmail.com
Mon May 16 20:50:14 UTC 2005


Welp... found a snipit of code, and easily added it, tested it, and it
seems to work great... still don't know anything about perl, but
here's my diff...

On 5/16/05, Mat Mrosko <myth.mrosko at gmail.com> wrote:
> > as usual, i'm open to features, bug fixes, patches en so on.
> 
> I know absolutely no perl, otherwise I'd toss a patch for this
> suggestion, but I think it would be great if you stripped the white
> space from the end of the "Description" field... I'm running this on
> my Simpsons Episodes, and I've noticed there's a good 20-40 characters
> of whitespace at the end of some of them... I guess I'm nit-picky like
> that... :)  Plus, I'm not sure if there's whitespace before, but in
> the MythVideo setup interface, the plot looks like it starts one line
> below... There is also a newline at the beginning after checking via
> mysql directly... the "edit" in mythweb did not show it, but it is
> there.
> 
> If anybody knows how to do a little text processing using perl/mysql,
> and can throw together something to go through the database, select
> all plots, and remove whitespace before and after, and put it back in,
> that would be awesome too!
> 
> -Mat
>
-------------- next part --------------
57a58,65
> sub trimwhitespace($)
> {
>     my $string = shift;
>     $string =~ s/^\s+//;
>     $string =~ s/\s+$//;
>     return $string;
> }
> 
80c88
<     $sth->execute($args{plot}, $args{rating}, $args{title}, $args{director}, $args{year}, $args{length}, $args{coverfile}, $args{intid});
---
>     $sth->execute(trimwhitespace($args{plot}), $args{rating}, $args{title}, $args{director}, $args{year}, $args{length}, $args{coverfile}, $args{intid});


More information about the mythtv-users mailing list