Skip to content

Commit

Permalink
MythGame: Install the MAWS metadata script.
Browse files Browse the repository at this point in the history
Also adapts the script to output proper version output.  The grabber is now available from the "Artwork and Data Sources" window.
  • Loading branch information
Robert McNamara committed Jan 23, 2011
1 parent d6d489f commit 909a1f1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mythplugins/mythgame/mythgame/mythgame.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TARGET = mythgame
LIBS += -lmythmetadata-$$LIBVERSION

installscripts.path = $${PREFIX}/share/mythtv/metadata/Game
installscripts.files = scripts/*.py
installscripts.files = scripts/*.py scripts/*.pl
installgiantbomb.path = $${PREFIX}/share/mythtv/metadata/Game/giantbomb
installgiantbomb.files = scripts/giantbomb/*.py
installgiantbombxsl.path = $${PREFIX}/share/mythtv/metadata/Game/giantbomb/XSLT
Expand Down
29 changes: 22 additions & 7 deletions mythplugins/mythgame/mythgame/scripts/maws.pl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@
my $header = '<?xml version="1.0" encoding="UTF-8"?>
<metadata>';
my $footer = '</metadata>';
our ($opt_M, $opt_D);
my $version = '<grabber>
<name>MAWS MAME Database</name>
<author>Auric</author>
<thumbnail>maws.png</thumbnail>
<command>maws.pl</command>
<type>games</type>
<description>MAWS is a MAME information and aggregation site.</description>
<version>0.01</version>
</grabber>';
our ($opt_M, $opt_D, $opt_v);
my @metaitems;
#################################### Util Subs ############################################
# If you copy this for another site, hopefully these won't need to changed
Expand Down Expand Up @@ -92,6 +101,10 @@ sub printitems {
}
}

sub printversion {
print "$version\n";
}

#################################### Site Specific Subs ##########################
sub search {
my $searchstr = shift @_;
Expand Down Expand Up @@ -228,9 +241,9 @@ sub queryinetref {
}

#################################### Main #####################################
getopts('M:D:');
getopts('vM:D:');

unless (($opt_M) || ($opt_D)){
unless (($opt_M) || ($opt_D) || ($opt_v)){
print "Error must have either -M search str or -D inetref\n";
cleanexit 1;
}
Expand All @@ -240,16 +253,18 @@ sub queryinetref {
$SIG{'TERM'} = \&cleanexit;
$SIG{'QUIT'} = \&cleanexit;

print "$header\n";

if ($opt_M) {
search($opt_M);
print "$header\n";
printitems();
print "$footer\n";
} elsif ($opt_D) {
queryinetref($opt_D);
print "$header\n";
printitems();
print "$footer\n";
} elsif ($opt_v) {
printversion();
}

print "$footer\n";

cleanexit 0;

0 comments on commit 909a1f1

Please sign in to comment.