diff options
Diffstat (limited to 'media-sound/banshee/files/banshee-2.0.1-musicbrainz-useragent.patch')
-rw-r--r-- | media-sound/banshee/files/banshee-2.0.1-musicbrainz-useragent.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/media-sound/banshee/files/banshee-2.0.1-musicbrainz-useragent.patch b/media-sound/banshee/files/banshee-2.0.1-musicbrainz-useragent.patch new file mode 100644 index 000000000000..c0a681b11888 --- /dev/null +++ b/media-sound/banshee/files/banshee-2.0.1-musicbrainz-useragent.patch @@ -0,0 +1,37 @@ +From 7e756d97b13be1301c487375a5589060a8befb76 Mon Sep 17 00:00:00 2001 +From: Gabriel Burt <gabriel.burt@gmail.com> +Date: Wed, 04 May 2011 21:03:32 +0000 +Subject: MusicBrainz: Allow specifying a UserAgent + +MB now requires a UserAgent to be set. This change will let Banshee set +one. +--- +diff --git a/src/Libraries/MusicBrainz/MusicBrainz/MusicBrainzObject.cs b/src/Libraries/MusicBrainz/MusicBrainz/MusicBrainzObject.cs +index 1a2732a..d83261e 100644 +--- a/src/Libraries/MusicBrainz/MusicBrainz/MusicBrainzObject.cs ++++ b/src/Libraries/MusicBrainz/MusicBrainz/MusicBrainzObject.cs +@@ -389,7 +389,8 @@ namespace MusicBrainz + if (min_interval > time) + Thread.Sleep ((min_interval - time).Milliseconds); + +- WebRequest request = WebRequest.Create (url); ++ var request = WebRequest.Create (url) as HttpWebRequest; ++ request.UserAgent = MusicBrainzService.UserAgent; + if (cache_implemented == null) { + try { + request.CachePolicy = MusicBrainzService.CachePolicy; +diff --git a/src/Libraries/MusicBrainz/MusicBrainz/MusicBrainzService.cs b/src/Libraries/MusicBrainz/MusicBrainz/MusicBrainzService.cs +index 5e860db..f868e2b 100644 +--- a/src/Libraries/MusicBrainz/MusicBrainz/MusicBrainzService.cs ++++ b/src/Libraries/MusicBrainz/MusicBrainz/MusicBrainzService.cs +@@ -36,6 +36,8 @@ namespace MusicBrainz + } + } + ++ public static string UserAgent { get; set; } ++ + static RequestCachePolicy cache_policy; + public static RequestCachePolicy CachePolicy { + get { return cache_policy; } +-- +cgit v0.9 |