Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MythGame: Install the MAWS metadata script.

Also adapts the script to output proper version output.  The grabber is now available from the "Artwork and Data Sources" window.
  • Loading branch information...
commit 909a1f190196789a36deae34252b28e916641c3c 1 parent d6d489f
Robert McNamara authored
View
2  mythplugins/mythgame/mythgame/mythgame.pro
@@ -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
View
29 mythplugins/mythgame/mythgame/scripts/maws.pl
@@ -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
@@ -92,6 +101,10 @@ sub printitems {
}
}
+sub printversion {
+ print "$version\n";
+}
+
#################################### Site Specific Subs ##########################
sub search {
my $searchstr = shift @_;
@@ -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;
}
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.