Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[mb-commits] r8714 - mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS: msg#00025

audio.musicbrainz.cvs

Subject: [mb-commits] r8714 - mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1

Author: robert
Date: 2006-12-15 08:10:28 +0000 (Fri, 15 Dec 2006)
New Revision: 8714

Modified:
mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Artist.pm
mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Common.pm
mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Release.pm
mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Track.pm
Log:
Implemented offset parameter for collections. Fixes #2314


Modified: mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Artist.pm
===================================================================
--- mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Artist.pm
2006-12-09 11:19:01 UTC (rev 8713)
+++ mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Artist.pm
2006-12-15 08:10:28 UTC (rev 8714)
@@ -72,10 +72,11 @@
my $name = $args{name} or "";
my $limit = $args{limit};
$limit = 25 if ($limit < 1 || $limit > 100);
+ my $offset = $args{offset} or 0;

return bad_req($r, "Must specify a name or query argument for
artist collections.") if (!$name && !$query);
return bad_req($r, "Must specify a name OR query argument for
artist collections. Not both.") if ($name && $query);
- return xml_search($r, { type => 'artist', artist => $name, limit =>
$limit, query=>$query });
+ return xml_search($r, { type => 'artist', artist => $name, limit =>
$limit, query=>$query, offset=>$offset });
}

my $status = eval {

Modified: mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Common.pm
===================================================================
--- mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Common.pm
2006-12-09 11:19:01 UTC (rev 8713)
+++ mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Common.pm
2006-12-15 08:10:28 UTC (rev 8714)
@@ -698,8 +698,9 @@
my $type = $args->{type};
my $query = "";
my $dur = 0;
+ my $offset = 0;

-
+ $offset = $args->{offset} if (defined $args->{offset} &&
MusicBrainz::Server::Validation::IsNonNegInteger($args->{offset}));
if (defined $args->{query} && $args->{query} ne "")
{
$query = $args->{query};
@@ -830,7 +831,7 @@

use URI::Escape qw( uri_escape );
my $url = 'http://' . &DBDefs::LUCENE_SERVER . "/ws/1/$type/?" .
- "max=" . $args->{limit} . "&type=$type&fmt=xml&query=".
uri_escape($query);
+ "max=" . $args->{limit} .
"&type=$type&fmt=xml&offset=$offset&query=". uri_escape($query);
my $out;

require LWP::UserAgent;

Modified: mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Release.pm
===================================================================
--- mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Release.pm
2006-12-09 11:19:01 UTC (rev 8713)
+++ mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Release.pm
2006-12-15 08:10:28 UTC (rev 8714)
@@ -81,6 +81,7 @@
my $artist = $args{artist} or "";
my $release = $args{release} or "";
my $query = $args{query} or "";
+ my $offset = $args{offset} or 0;
my ($info, $bad) = get_type_and_status_from_inc($args{releasetypes} or
"");

my $limit = $args{limit};
@@ -96,7 +97,7 @@

return bad_req($r, "Must specify a title OR query argument for
release collections. Not both.") if ($title && $query);

- return xml_search($r, {type=>'release', artist=>$artist,
release=>$title,
+ return xml_search($r, {type=>'release', artist=>$artist,
release=>$title, offset=>$offset,
artistid => $artistid, limit => $limit,
releasetype => $info->{type},
releasestatus=> $info->{status}, count=>
$count, discids=>$discids,
date => $date, asin=>$asin, lang=>$lang,
script=>$script, query=>$query });

Modified: mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Track.pm
===================================================================
--- mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Track.pm
2006-12-09 11:19:01 UTC (rev 8713)
+++ mb_server/trunk/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Track.pm
2006-12-15 08:10:28 UTC (rev 8714)
@@ -73,6 +73,7 @@

my $title = $args{title} or "";
my $query = $args{query} or "";
+ my $offset = $args{offset} or 0;
my $artist = $args{artist} or "";
my $release = $args{release} or "";
my $count = $args{count} or 0;
@@ -105,7 +106,7 @@
return xml_search($r, {type=>'track', track=>$title, artist=>$artist,
release=>$release,
artistid => $artistid, releaseid=>$releaseid,
duration=>$duration,
tracknumber => $tnum, limit => $limit, count =>
$count, releasetype=>$releasetype,
- query=>$query});
+ query=>$query, offset=>$offset});
}

my $status = eval


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
solaris.opensol...    editors.vim/200...    web.turbogears....    jakarta.ant.dev...    mathematics.max...    text.unicode.ge...    lang.ruby.core/...    xfce.announce/2...    network.centeri...    php.cvs.pear/20...    user-groups.lin...    kde.devel.quant...    file-systems.ar...    redhat.fedora.t...    apple.fink.auto...    gnome.orbit.gen...    qplus.devel/200...    culture.transpo...    video.dri.user/...    operators.nanog...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation