banshee r2960 - in trunk/banshee: . src/Core/Banshee.Base src/Core/Banshee.Base/Banshee.Metadata src/Core/Banshee.Base/Banshee.Metadata.Embedded src/Core/Banshee.Base/Banshee.Metadata.MusicBrainz src/Core/Banshee.Base/Banshee.Metadata.Rhapsody src/Core/Banshee.Base/NetworkManager src/Core/Banshee.Core src/Core/Banshee.Core/Banshee.Base src/Core/Banshee.Core/Banshee.Collection src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.Metadata src/Core/Banshee.Services/Banshee.Metadata.Embedded src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz src/Core/Banshee.Services/Banshee.Metadata.Rhapsody src/Core/Banshee.Services/Banshee.Networking src/Core/Banshee.ThickClient src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Core/Banshee.Widgets src/Core/Hyena src/Core/Hyena.Gui
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r2960 - in trunk/banshee: . src/Core/Banshee.Base src/Core/Banshee.Base/Banshee.Metadata src/Core/Banshee.Base/Banshee.Metadata.Embedded src/Core/Banshee.Base/Banshee.Metadata.MusicBrainz src/Core/Banshee.Base/Banshee.Metadata.Rhapsody src/Core/Banshee.Base/NetworkManager src/Core/Banshee.Core src/Core/Banshee.Core/Banshee.Base src/Core/Banshee.Core/Banshee.Collection src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.Metadata src/Core/Banshee.Services/Banshee.Metadata.Embedded src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz src/Core/Banshee.Services/Banshee.Metadata.Rhapsody src/Core/Banshee.Services/Banshee.Networking src/Core/Banshee.ThickClient src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Core/Banshee.Widgets src/Core/Hyena src/Core/Hyena.Gui
- Date: Thu, 10 Jan 2008 20:59:40 +0000 (GMT)
Author: abock
Date: Thu Jan 10 20:59:39 2008
New Revision: 2960
URL: http://svn.gnome.org/viewvc/banshee?rev=2960&view=rev
Log:
2008-01-11 Aaron Bockover <abock gnome org>
* src/Core/Banshee.Core/Banshee.Base/CoverArtSpec.cs: A small API that
provides a layer of query/ID generation methods for the local disk cover
art cache
* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkManager.cs:
Updated to use the new CoverArtSpec APIs
* src/Core/Banshee.Services/Banshee.Metadata:
* src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz:
* src/Core/Banshee.Services/Banshee.Metadata.Embedded:
* src/Core/Banshee.Services/Banshee.Metadata.Rhapsody: Ported the
Metadata Services Stack from stable; updated to run in the services layer
so no Gdk/GUI libraries are required; use new CoverArtSpec APIs
* src/Core/Banshee.Services/Banshee.Networking: Ported the networking
layer from stable
Added:
trunk/banshee/src/Core/Banshee.Core/Banshee.Base/CoverArtSpec.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/
- copied from r2950, /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata/
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Embedded/
- copied from r2950, /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.Embedded/
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/
- copied from r2950, /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.MusicBrainz/
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/
- copied from r2950, /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.Rhapsody/
trunk/banshee/src/Core/Banshee.Services/Banshee.Networking/
trunk/banshee/src/Core/Banshee.Services/Banshee.Networking/NetworkDetect.cs
- copied, changed from r2950, /trunk/banshee/src/Core/Banshee.Base/NetworkDetect.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Networking/NetworkManager.cs
- copied, changed from r2950, /trunk/banshee/src/Core/Banshee.Base/NetworkManager/Manager.cs
Removed:
trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata/
trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.Embedded/
trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.MusicBrainz/
trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.Rhapsody/
trunk/banshee/src/Core/Banshee.Base/NetworkDetect.cs
trunk/banshee/src/Core/Banshee.Base/NetworkManager/Manager.cs
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Core/Banshee.Base/Paths.cs
trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs
trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
trunk/banshee/src/Core/Banshee.Core/Banshee.Core.mdp
trunk/banshee/src/Core/Banshee.Core/Makefile.am
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Embedded/EmbeddedMetadataProvider.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Embedded/EmbeddedQueryJob.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzMetadataProvider.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyMetadataProvider.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/BaseMetadataProvider.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/IMetadataLookupJob.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/IMetadataProvider.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataService.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataServiceJob.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataSettings.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
trunk/banshee/src/Core/Banshee.Services/Makefile.am
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkManager.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am
trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets.mdp
trunk/banshee/src/Core/Hyena.Gui/Hyena.Gui.mdp
trunk/banshee/src/Core/Hyena/Hyena.mdp
trunk/banshee/src/Core/Hyena/Makefile.am
Added: trunk/banshee/src/Core/Banshee.Core/Banshee.Base/CoverArtSpec.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Base/CoverArtSpec.cs Thu Jan 10 20:59:39 2008
@@ -0,0 +1,100 @@
+//
+// CoverArtSpec.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2007-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Text.RegularExpressions;
+
+namespace Banshee.Base
+{
+ public static class CoverArtSpec
+ {
+ public static bool CoverExists (string artist, string album)
+ {
+ return CoverExists (CreateArtistAlbumId (artist, album));
+ }
+
+ public static bool CoverExists (string aaid)
+ {
+ return CoverExistsForSize (aaid, 0);
+ }
+
+ public static bool CoverExistsForSize (string aaid, int size)
+ {
+ return File.Exists (GetPathForSize (aaid, size));
+ }
+
+ public static string GetPath (string aaid)
+ {
+ return GetPathForSize (aaid, 0);
+ }
+
+ public static string GetPathForSize (string aaid, int size)
+ {
+ return size == 0
+ ? Path.Combine (RootPath, String.Format ("{0}.jpg", aaid))
+ : Path.Combine (RootPath, Path.Combine (size.ToString (), String.Format ("{0}.jpg", aaid)));
+ }
+
+ public static string CreateArtistAlbumId (string artist, string album)
+ {
+ return CreateArtistAlbumId (artist, album, false);
+ }
+
+ public static string CreateArtistAlbumId (string artist, string album, bool asUriPart)
+ {
+ string sm_artist = CreateArtistAlbumIdPart (artist);
+ string sm_album = CreateArtistAlbumIdPart (album);
+
+ return sm_artist == null || sm_album == null
+ ? null
+ : String.Format ("{0}{1}{2}", sm_artist, asUriPart ? "/" : "-", sm_album);
+ }
+
+ private static string CreateArtistAlbumIdPart (string part)
+ {
+ if (String.IsNullOrEmpty (part)) {
+ return null;
+ }
+
+ int lp_index = part.LastIndexOf ('(');
+ if (lp_index > 0) {
+ part = part.Substring (0, lp_index);
+ }
+
+ return Regex.Replace (part, @"[^A-Za-z0-9]*", "").ToLower ();
+ }
+
+ private static string root_path =
+ Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData), "album-art");
+
+ public static string RootPath {
+ get { return root_path; }
+ }
+ }
+}
Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Base/Paths.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Base/Paths.cs (original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Base/Paths.cs Thu Jan 10 20:59:39 2008
@@ -84,6 +84,23 @@
return Path.Combine (home_dir, fallback);
}
+
+ public static string Combine (string first, params string [] components)
+ {
+ if (String.IsNullOrEmpty (first)) {
+ throw new ArgumentException ("First component must not be null or empty", "first");
+ } else if (components == null || components.Length < 1) {
+ throw new ArgumentException ("One or more path components must be provided", "components");
+ }
+
+ string result = first;
+
+ foreach (string component in components) {
+ result = Path.Combine (result, component);
+ }
+
+ return result;
+ }
public static string LegacyApplicationData {
get {
Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs (original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs Thu Jan 10 20:59:39 2008
@@ -29,6 +29,8 @@
using System;
using System.Text.RegularExpressions;
+using Banshee.Base;
+
namespace Banshee.Collection
{
public class AlbumInfo
@@ -42,35 +44,6 @@
this.title = title;
}
- public static string CreateArtistAlbumId (string artist, string album)
- {
- return CreateArtistAlbumId (artist, album, false);
- }
-
- public static string CreateArtistAlbumId (string artist, string album, bool asPath)
- {
- string sm_artist = CreateArtistAlbumIdPart (artist);
- string sm_album = CreateArtistAlbumIdPart (album);
-
- return sm_artist == null || sm_album == null
- ? null
- : String.Format ("{0}{1}{2}", sm_artist, asPath ? "/" : "-", sm_album);
- }
-
- private static string CreateArtistAlbumIdPart (string part)
- {
- if (String.IsNullOrEmpty (part)) {
- return null;
- }
-
- int lp_index = part.LastIndexOf ('(');
- if (lp_index > 0) {
- part = part.Substring (0, lp_index);
- }
-
- return Regex.Replace (part, @"[^A-Za-z0-9]*", "").ToLower ();
- }
-
public virtual string ArtistName {
get { return artist_name; }
set { artist_name = value; }
@@ -84,7 +57,7 @@
public virtual string ArtworkId {
get {
if (artwork_id == null) {
- artwork_id = CreateArtistAlbumId (ArtistName, Title);
+ artwork_id = CoverArtSpec.CreateArtistAlbumId (ArtistName, Title);
}
return artwork_id;
Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs (original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs Thu Jan 10 20:59:39 2008
@@ -151,7 +151,7 @@
}
public string ArtistAlbumId {
- get { return AlbumInfo.CreateArtistAlbumId (ArtistName, AlbumTitle); }
+ get { return CoverArtSpec.CreateArtistAlbumId (ArtistName, AlbumTitle); }
}
public virtual string Genre {
Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Core.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Core.mdp (original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Core.mdp Thu Jan 10 20:59:39 2008
@@ -53,6 +53,9 @@
<File name="Resources/contributors.xml" subtype="Code" buildaction="EmbedAsResource" />
<File name="Resources/translators.xml" subtype="Code" buildaction="EmbedAsResource" />
<File name="Resources/COPYING" subtype="Code" buildaction="EmbedAsResource" />
+ <File name="Banshee.Base/Localization.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Configuration/XmlConfigurationClient.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Base/CoverArtSpec.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Project" localcopy="False" refto="Hyena" />
Modified: trunk/banshee/src/Core/Banshee.Core/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Makefile.am (original)
+++ trunk/banshee/src/Core/Banshee.Core/Makefile.am Thu Jan 10 20:59:39 2008
@@ -3,6 +3,7 @@
LINK = $(REF_BANSHEE_CORE)
SOURCES = \
Banshee.Base/ApplicationContext.cs \
+ Banshee.Base/CoverArtSpec.cs \
Banshee.Base/FileNamePattern.cs \
Banshee.Base/Localization.cs \
Banshee.Base/Log.cs \
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Embedded/EmbeddedMetadataProvider.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.Embedded/EmbeddedMetadataProvider.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Embedded/EmbeddedMetadataProvider.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,31 @@
-/***************************************************************************
- * EmbeddedMetadataProvider.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Trey Ethridge <tale juno com>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// EmbeddedMetadataProvider.cs
+//
+// Authors:
+// Trey Ethridge <tale juno com>
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Collections.Generic;
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Embedded/EmbeddedQueryJob.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.Embedded/EmbeddedQueryJob.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Embedded/EmbeddedQueryJob.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,30 @@
-/***************************************************************************
- * EmbeddedQueryJob.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Trey Ethridge <tale juno com>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// EmbeddedQueryJob.cs
+//
+// Authors:
+// Trey Ethridge <tale juno com>
+//
+// Copyright (C) 2006-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Collections.Generic;
@@ -34,6 +34,7 @@
using Banshee.Base;
using Banshee.Metadata;
using Banshee.Collection;
+using Banshee.Streaming;
namespace Banshee.Metadata.Embedded
{
@@ -50,24 +51,19 @@
public override void Run()
{
- if(track == null || track.CoverArtFileName != null) {
+ if(track == null || CoverArtSpec.CoverExists (track.ArtistAlbumId)) {
return;
}
- string embedded_cover_art_file = Fetch();
-
- if(embedded_cover_art_file != null) {
- track.CoverArtFileName = embedded_cover_art_file;
- }
+ Fetch();
}
- protected string Fetch()
+ protected void Fetch()
{
- string image_path = null;
- string artist_album_id = AlbumInfo.CreateArtistAlbumId(track.ArtistName, track.AlbumTitle, false);
+ string artist_album_id = track.ArtistAlbumId;
if(artist_album_id == null) {
- return null;
+ return;
}
IPicture [] pictures = GetEmbeddedPictures(track.Uri);
@@ -75,7 +71,7 @@
if(pictures != null && pictures.Length > 0) {
int preferred_index = GetPictureIndexToUse(pictures);
IPicture picture = pictures[preferred_index];
- string path = Paths.GetCoverArtPath(artist_album_id);
+ string path = CoverArtSpec.GetPath(artist_album_id);
if(SavePicture(picture, path)) {
StreamTag tag = new StreamTag();
@@ -83,12 +79,8 @@
tag.Value = artist_album_id;
AddTag(tag);
-
- image_path = path;
}
}
-
- return image_path;
}
protected IPicture [] GetEmbeddedPictures(SafeUri uri)
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzMetadataProvider.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.MusicBrainz/MusicBrainzMetadataProvider.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzMetadataProvider.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,30 @@
-/***************************************************************************
- * IMetadataProvider.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Aaron Bockover <aaron abock org>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// MusicBrainzMetadataProvider.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Collections.Generic;
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,30 @@
-/***************************************************************************
- * MusicBrainzQueryJob.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by James Willcox <snorp novell com>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// MusicBrainzQueryJob.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.IO;
@@ -37,6 +37,7 @@
using Banshee.Metadata;
using Banshee.Kernel;
using Banshee.Collection;
+using Banshee.Streaming;
namespace Banshee.Metadata.MusicBrainz
{
@@ -66,14 +67,15 @@
public bool Lookup()
{
- if(track == null || track.CoverArtFileName != null) {
+ if(track == null) {
return false;
}
- string album_artist_id = AlbumInfo.CreateArtistAlbumId(track.ArtistName, track.AlbumTitle, false);
+ string album_artist_id = track.ArtistAlbumId;
+
if(album_artist_id == null) {
return false;
- } else if(File.Exists(Paths.GetCoverArtPath(album_artist_id))) {
+ } else if(CoverArtSpec.CoverExists(album_artist_id)) {
return false;
} else if(!Settings.NetworkConnected) {
return false;
@@ -86,7 +88,7 @@
}
}
- if(SaveHttpStreamPixbuf(new Uri(String.Format(AmazonUriFormat, asin)), album_artist_id,
+ if(SaveHttpStreamCover(new Uri(String.Format(AmazonUriFormat, asin)), album_artist_id,
new string [] { "image/gif" })) {
StreamTag tag = new StreamTag();
tag.Name = CommonTags.AlbumCoverId;
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyMetadataProvider.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.Rhapsody/RhapsodyMetadataProvider.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyMetadataProvider.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,30 @@
-/***************************************************************************
- * IMetadataProvider.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Aaron Bockover <aaron abock org>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// RhapsodyMetadataProvider.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Collections.Generic;
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,30 @@
-/***************************************************************************
- * RhapsodyQueryJob.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Aaron Bockover <aaron abock org>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// RhapsodyQueryJob.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.IO;
@@ -34,12 +34,11 @@
using System.Text.RegularExpressions;
using System.Collections.Generic;
-using Gdk;
-
using Banshee.Base;
using Banshee.Collection;
using Banshee.Metadata;
using Banshee.Kernel;
+using Banshee.Streaming;
namespace Banshee.Metadata.Rhapsody
{
@@ -55,16 +54,13 @@
public override void Run()
{
- if(Track == null || (Track is TrackInfo && (Track as TrackInfo).CoverArtFileName != null)) {
+ if(Track == null) {
return;
}
- string album_artist_id = AlbumInfo.CreateArtistAlbumId(Track.ArtistName, Track.AlbumTitle, false);
- if(album_artist_id == null) {
- return;
- } else if(File.Exists(Paths.GetCoverArtPath(album_artist_id))) {
- return;
- } else if(!Settings.NetworkConnected) {
+ string album_artist_id = CoverArtSpec.CreateArtistAlbumId(Track.ArtistName, Track.AlbumTitle, false);
+
+ if(album_artist_id == null || CoverArtSpec.CoverExists(album_artist_id) || !Settings.NetworkConnected) {
return;
}
@@ -83,7 +79,7 @@
XmlNode art_node = doc.DocumentElement.SelectSingleNode("/album/art/album-art[ size='large']/img");
if(art_node != null && art_node.Attributes["src"] != null) {
Uri art_uri = new Uri(art_node.Attributes["src"].Value);
- if(SaveHttpStreamPixbuf(art_uri, album_artist_id, null)) {
+ if(SaveHttpStreamCover(art_uri, album_artist_id, null)) {
StreamTag tag = new StreamTag();
tag.Name = CommonTags.AlbumCoverId;
tag.Value = album_artist_id;
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/BaseMetadataProvider.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata/BaseMetadataProvider.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/BaseMetadataProvider.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,30 @@
-/***************************************************************************
- * BaseMetadataProvider.cs
- *
- * Copyright (C) 2007 Novell, Inc.
- * Written by Aaron Bockover <aaron abock org>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// BaseMetadataProvider.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2007 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Collections.Generic;
@@ -32,6 +32,7 @@
using Banshee.Base;
using Banshee.Collection;
+using Banshee.Streaming;
namespace Banshee.Metadata
{
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/IMetadataLookupJob.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata/IMetadataLookupJob.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/IMetadataLookupJob.cs Thu Jan 10 20:59:39 2008
@@ -1,36 +1,38 @@
-/***************************************************************************
- * IMetadataLookupJob.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Aaron Bockover <aaron abock org>
- ****************************************************************************/
+//
+// IMetadataLookupJob.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2007 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
using System.Collections.Generic;
using Banshee.Kernel;
using Banshee.Base;
using Banshee.Collection;
+using Banshee.Streaming;
namespace Banshee.Metadata
{
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/IMetadataProvider.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata/IMetadataProvider.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/IMetadataProvider.cs Thu Jan 10 20:59:39 2008
@@ -1,36 +1,37 @@
-/***************************************************************************
- * IMetadataProvider.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Aaron Bockover <aaron abock org>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// IMetadataProvider.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2007 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Collections.ObjectModel;
using Banshee.Base;
using Banshee.Collection;
+using Banshee.Streaming;
namespace Banshee.Metadata
{
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataService.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata/MetadataService.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataService.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,30 @@
-/***************************************************************************
- * MetadataService.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Aaron Bockover <aaron abock org>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// MetadataService.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2007 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Collections;
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataServiceJob.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata/MetadataServiceJob.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataServiceJob.cs Thu Jan 10 20:59:39 2008
@@ -1,30 +1,30 @@
-/***************************************************************************
- * MetadataServiceJob.cs
- *
- * Copyright (C) 2006-2007 Novell, Inc.
- * Written by Aaron Bockover <aaron abock org>
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
+//
+// MetadataServiceJob.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.IO;
@@ -34,6 +34,8 @@
using Banshee.Kernel;
using Banshee.Base;
using Banshee.Collection;
+using Banshee.Streaming;
+using Banshee.Networking;
namespace Banshee.Metadata
{
@@ -154,21 +156,9 @@
return true;
}
- protected bool SaveHttpStreamPixbuf(Uri uri, string albumArtistId, string [] ignoreMimeTypes)
+ protected bool SaveHttpStreamCover (Uri uri, string albumArtistId, string [] ignoreMimeTypes)
{
- Stream stream = GetHttpStream(uri, ignoreMimeTypes);
- if(stream == null) {
- return false;
- }
-
- using(stream) {
- Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(stream);
- if(pixbuf == null || pixbuf.Width < 50 || pixbuf.Height < 50) {
- return false;
- }
-
- return pixbuf.Save(Paths.GetCoverArtPath(albumArtistId), "jpeg");
- }
+ return SaveHttpStream (uri, CoverArtSpec.GetPath (albumArtistId), ignoreMimeTypes);
}
}
}
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataSettings.cs
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/Banshee.Metadata/MetadataSettings.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Metadata/MetadataSettings.cs Thu Jan 10 20:59:39 2008
@@ -1,31 +1,31 @@
-/***************************************************************************
- * MetadataSettings.cs
- *
- * Copyright (C) 2007 Novell, Inc.
- * Written by Aaron Bockover <abockover novell com>
- ****************************************************************************/
+//
+// MetadataSettings.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2006-2007 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
using System;
namespace Banshee.Metadata
Copied: trunk/banshee/src/Core/Banshee.Services/Banshee.Networking/NetworkDetect.cs (from r2950, /trunk/banshee/src/Core/Banshee.Base/NetworkDetect.cs)
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/NetworkDetect.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Networking/NetworkDetect.cs Thu Jan 10 20:59:39 2008
@@ -1,37 +1,37 @@
-/***************************************************************************
- * NetworkDetect.cs
- *
- * Copyright (C) 2005-2006 Novell, Inc.
- * Written by Aaron Bockover (aaron abock org)
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
+//
+// NetworkDetect.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2005-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System;
using System.Collections;
using Mono.Unix;
-using NetworkManager;
+using Banshee.Base;
-namespace Banshee.Base
+namespace Banshee.Networking
{
public delegate void NetworkStateChangedHandler(object o, NetworkStateChangedArgs args);
@@ -55,7 +55,7 @@
{
public event NetworkStateChangedHandler StateChanged;
- private Manager nm_manager;
+ private NetworkManager nm_manager;
private State current_state;
private static NetworkDetect instance;
@@ -75,7 +75,7 @@
ConnectToNetworkManager();
} catch(Exception) {
nm_manager = null;
- LogCore.Instance.PushWarning(
+ Log.Warning(
Catalog.GetString("Cannot connect to NetworkManager"),
Catalog.GetString("An available, working network connection will be assumed"),
false);
@@ -84,7 +84,7 @@
private void ConnectToNetworkManager()
{
- nm_manager = new Manager();
+ nm_manager = new NetworkManager();
nm_manager.StateChange += OnNetworkManagerEvent;
current_state = nm_manager.State;
}
@@ -103,9 +103,9 @@
}
if(Connected) {
- LogCore.Instance.PushDebug("Network Connection Established", "Connected");
+ Log.Debug("Network Connection Established", "Connected");
} else {
- LogCore.Instance.PushDebug("Network Connection Unavailable", "Disconnected");
+ Log.Debug("Network Connection Unavailable", "Disconnected");
}
}
} catch(Exception) {
@@ -116,7 +116,7 @@
get { return nm_manager == null ? true : current_state == State.Connected; }
}
- public Manager Manager {
+ public NetworkManager Manager {
get { return nm_manager; }
}
}
Copied: trunk/banshee/src/Core/Banshee.Services/Banshee.Networking/NetworkManager.cs (from r2950, /trunk/banshee/src/Core/Banshee.Base/NetworkManager/Manager.cs)
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Base/NetworkManager/Manager.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Networking/NetworkManager.cs Thu Jan 10 20:59:39 2008
@@ -1,38 +1,38 @@
-/***************************************************************************
- * Manager.cs
- *
- * Copyright (C) 2005-2006 Novell, Inc.
- * Written by Aaron Bockover (aaron abock org)
- ****************************************************************************/
-
-/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
+//
+// NetworkManager.cs
+//
+// Author:
+// Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2005-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using NDesk.DBus;
-namespace NetworkManager
+namespace Banshee.Networking
{
public enum State : uint {
Unknown = 0,
@@ -51,7 +51,7 @@
public delegate void StateChangeHandler(State state);
- public class Manager
+ public class NetworkManager
{
private const string BusName = "org.freedesktop.NetworkManager";
private const string ObjectPath = "/org/freedesktop/NetworkManager";
@@ -60,7 +60,7 @@
public event StateChangeHandler StateChange;
- public Manager()
+ public NetworkManager()
{
if(!Bus.System.NameHasOwner(BusName)) {
throw new ApplicationException(String.Format("Name {0} has no owner", BusName));
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp Thu Jan 10 20:59:39 2008
@@ -83,6 +83,33 @@
<File name="Banshee.MediaEngine/IPlaybackController.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.Collection/BansheeListModel.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.Database/TableSchema.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles/GConfProfileConfiguration.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles/Pipeline.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles/PipelineVariable.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles/Profile.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles/ProfileConfiguration.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles/ProfileManager.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Playlist/AbstractPlaylistSource.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Playlist/PlaylistFileUtil.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.SmartPlaylist/Migrator.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.SmartPlaylist/SmartPlaylistCore.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.SmartPlaylist/SmartPlaylistSource.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Sources/IImportable.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Sources/IUnmapableSource.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata/BaseMetadataProvider.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata/IMetadataLookupJob.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata/IMetadataProvider.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata/MetadataService.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata/MetadataServiceJob.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata/MetadataSettings.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata.Embedded/EmbeddedMetadataProvider.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata.Embedded/EmbeddedQueryJob.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata.MusicBrainz/MusicBrainzMetadataProvider.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata.Rhapsody/RhapsodyMetadataProvider.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Networking/NetworkDetect.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Networking/NetworkManager.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
Modified: trunk/banshee/src/Core/Banshee.Services/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Makefile.am (original)
+++ trunk/banshee/src/Core/Banshee.Services/Makefile.am Thu Jan 10 20:59:39 2008
@@ -7,8 +7,8 @@
Banshee.AudioProfiles/GConfProfileConfiguration.cs \
Banshee.AudioProfiles/Pipeline.cs \
Banshee.AudioProfiles/PipelineVariable.cs \
- Banshee.AudioProfiles/ProfileConfiguration.cs \
Banshee.AudioProfiles/Profile.cs \
+ Banshee.AudioProfiles/ProfileConfiguration.cs \
Banshee.AudioProfiles/ProfileManager.cs \
Banshee.Collection.Database/AlbumListDatabaseModel.cs \
Banshee.Collection.Database/ArtistListDatabaseModel.cs \
@@ -47,9 +47,23 @@
Banshee.MediaEngine/PlayerEngineEvent.cs \
Banshee.MediaEngine/PlayerEngineService.cs \
Banshee.MediaEngine/PlayerEngineState.cs \
+ Banshee.Metadata.Embedded/EmbeddedMetadataProvider.cs \
+ Banshee.Metadata.Embedded/EmbeddedQueryJob.cs \
+ Banshee.Metadata.MusicBrainz/MusicBrainzMetadataProvider.cs \
+ Banshee.Metadata.MusicBrainz/MusicBrainzQueryJob.cs \
+ Banshee.Metadata.Rhapsody/RhapsodyMetadataProvider.cs \
+ Banshee.Metadata.Rhapsody/RhapsodyQueryJob.cs \
+ Banshee.Metadata/BaseMetadataProvider.cs \
+ Banshee.Metadata/IMetadataLookupJob.cs \
+ Banshee.Metadata/IMetadataProvider.cs \
+ Banshee.Metadata/MetadataService.cs \
+ Banshee.Metadata/MetadataServiceJob.cs \
+ Banshee.Metadata/MetadataSettings.cs \
+ Banshee.Networking/NetworkDetect.cs \
+ Banshee.Networking/NetworkManager.cs \
Banshee.Playlist/AbstractPlaylistSource.cs \
- Banshee.Playlist/PlaylistSource.cs \
Banshee.Playlist/PlaylistFileUtil.cs \
+ Banshee.Playlist/PlaylistSource.cs \
Banshee.Playlists.Formats.Xspf/LinkEntry.cs \
Banshee.Playlists.Formats.Xspf/MetaEntry.cs \
Banshee.Playlists.Formats.Xspf/Playlist.cs \
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkManager.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkManager.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkManager.cs Thu Jan 10 20:59:39 2008
@@ -4,7 +4,7 @@
// Author:
// Aaron Bockover <abockover novell com>
//
-// Copyright (C) 2007 Novell, Inc.
+// Copyright (C) 2007-2008 Novell, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -53,7 +53,7 @@
private void MigrateLegacyAlbumArt ()
{
- if (Directory.Exists (ArtworkPath)) {
+ if (Directory.Exists (CoverArtSpec.RootPath)) {
return;
}
@@ -63,10 +63,10 @@
int artwork_count = 0;
if (Directory.Exists (legacy_artwork_path)) {
- Directory.CreateDirectory (ArtworkPath);
+ Directory.CreateDirectory (CoverArtSpec.RootPath);
foreach (string path in Directory.GetFiles (legacy_artwork_path)) {
- string dest_path = Path.Combine (ArtworkPath, Path.GetFileName (path));
+ string dest_path = Path.Combine (CoverArtSpec.RootPath, Path.GetFileName (path));
File.Copy (path, dest_path);
artwork_count++;
@@ -78,7 +78,7 @@
public Pixbuf Lookup (string artist, string album)
{
- return Lookup (AlbumInfo.CreateArtistAlbumId (artist, album));
+ return Lookup (CoverArtSpec.CreateArtistAlbumId (artist, album));
}
public Pixbuf Lookup (string id)
@@ -92,12 +92,22 @@
return null;
}
- string path = GetPathForSize (id, size);
+ string path = CoverArtSpec.GetPathForSize (id, size);
if (File.Exists (path)) {
+ if (Path.GetExtension (path) == "cover") {
+ Pixbuf pixbuf = new Pixbuf (path);
+ if (pixbuf.Width < 50 || pixbuf.Height < 50) {
+ File.Delete (path);
+ return null;
+ }
+ pixbuf.Save (Path.ChangeExtension (path, "jpg"), "jpeg");
+ return pixbuf;
+ }
+
return new Pixbuf (path);
}
- string orig_path = GetPathForSize (id, 0);
+ string orig_path = CoverArtSpec.GetPathForSize (id, 0);
if (File.Exists (orig_path)) {
Pixbuf pixbuf = new Pixbuf (orig_path);
Pixbuf scaled_pixbuf = pixbuf.ScaleSimple (size, size, Gdk.InterpType.Bilinear);
@@ -110,20 +120,6 @@
return null;
}
- private string GetPathForSize (string id, int size)
- {
- return size == 0
- ? Path.Combine (ArtworkPath, String.Format ("{0}.jpg", id))
- : Path.Combine (ArtworkPath, Path.Combine (size.ToString (), String.Format ("{0}.jpg", id)));
- }
-
- private static string artwork_path =
- Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData), "album-art");
-
- public static string ArtworkPath {
- get { return artwork_path; }
- }
-
string IService.ServiceName {
get { return "ArtworkManager"; }
}
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp Thu Jan 10 20:59:39 2008
@@ -62,6 +62,15 @@
<File name="Banshee.Gui/ViewActions.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.Gui/TrackActions.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.Gui.Widgets/ArtworkPopup.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles.Gui/ProfileComboBox.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles.Gui/ProfileComboBoxConfigurable.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles.Gui/ProfileConfigurationDialog.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles.Gui/ProfileConfigureButton.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.AudioProfiles.Gui/TextViewLabel.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Collection.Gui/ColumnCellDateTime.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Gui/BansheeActionGroup.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Gui/IHasSourceView.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Gui/SourceActions.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Project" localcopy="False" refto="Hyena.Gui" />
@@ -77,6 +86,7 @@
<ProjectReference type="Gac" localcopy="True" refto="glib-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="pango-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</References>
+ <Deployment.LinuxDeployData generateScript="False" />
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="True" Name="SOURCES" />
<DeployFilesVar />
@@ -86,5 +96,4 @@
<AsmRefVar />
<ProjectRefVar />
</MonoDevelop.Autotools.MakefileInfo>
- <Deployment.LinuxDeployData generateScript="False" />
</Project>
\ No newline at end of file
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am Thu Jan 10 20:59:39 2008
@@ -4,9 +4,9 @@
LINK = $(REF_BANSHEE_THICKCLIENT)
SOURCES = \
- Banshee.AudioProfiles.Gui/ProfileConfigurationDialog.cs \
Banshee.AudioProfiles.Gui/ProfileComboBox.cs \
Banshee.AudioProfiles.Gui/ProfileComboBoxConfigurable.cs \
+ Banshee.AudioProfiles.Gui/ProfileConfigurationDialog.cs \
Banshee.AudioProfiles.Gui/ProfileConfigureButton.cs \
Banshee.AudioProfiles.Gui/TextViewLabel.cs \
Banshee.Collection.Gui/AlbumListView.cs \
Modified: trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets.mdp (original)
+++ trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets.mdp Thu Jan 10 20:59:39 2008
@@ -45,6 +45,8 @@
<File name="Banshee.Widgets/ToggleState.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.Widgets/VolumeButton.cs" subtype="Code" buildaction="Compile" />
<File name="Banshee.Widgets/GenericToolItem.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Widgets/CustomActionProxy.cs" subtype="Code" buildaction="Compile" />
+ <File name="Banshee.Widgets/RatingActionProxy.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
Modified: trunk/banshee/src/Core/Hyena.Gui/Hyena.Gui.mdp
==============================================================================
--- trunk/banshee/src/Core/Hyena.Gui/Hyena.Gui.mdp (original)
+++ trunk/banshee/src/Core/Hyena.Gui/Hyena.Gui.mdp Thu Jan 10 20:59:39 2008
@@ -37,6 +37,7 @@
<ProjectReference type="Project" localcopy="False" refto="Hyena" />
<ProjectReference type="Gac" localcopy="True" refto="pango-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</References>
+ <Deployment.LinuxDeployData generateScript="False" />
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="True" Name="SOURCES" />
<DeployFilesVar />
@@ -46,5 +47,4 @@
<AsmRefVar />
<ProjectRefVar />
</MonoDevelop.Autotools.MakefileInfo>
- <Deployment.LinuxDeployData generateScript="False" />
</Project>
\ No newline at end of file
Modified: trunk/banshee/src/Core/Hyena/Hyena.mdp
==============================================================================
--- trunk/banshee/src/Core/Hyena/Hyena.mdp (original)
+++ trunk/banshee/src/Core/Hyena/Hyena.mdp Thu Jan 10 20:59:39 2008
@@ -14,16 +14,13 @@
<File name="Hyena.Data/IListModel.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data/ISortable.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data/ISortableColumn.cs" subtype="Code" buildaction="Compile" />
- <File name="Hyena.Data/ListItemSetup.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data/ModelSelection.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data/SortType.cs" subtype="Code" buildaction="Compile" />
- <File name="Hyena.Data.Query/QueryKeywordNode.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data.Query/QueryListNode.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data.Query/QueryNode.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data.Query/QueryParser.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data.Query/QueryTermNode.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data.Query/QueryToken.cs" subtype="Code" buildaction="Compile" />
- <File name="Hyena.Data.Query/SqlQueryGenerator.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data/PropertyStore.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.CommandLine/Layout.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.CommandLine/LayoutOption.cs" subtype="Code" buildaction="Compile" />
@@ -35,10 +32,13 @@
<File name="Hyena.Data/ColumnDescription.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data/CacheableModelAdapter.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Data/ICacheableModel.cs" subtype="Code" buildaction="Compile" />
- <File name="Hyena.Data/Selection.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Collections/RangeCollection.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Collections/IStackProvider.cs" subtype="Code" buildaction="Compile" />
<File name="Hyena.Collections/IntervalHeap.cs" subtype="Code" buildaction="Compile" />
+ <File name="Hyena.Collections/Selection.cs" subtype="Code" buildaction="Compile" />
+ <File name="Hyena.Collections/SelectionProxy.cs" subtype="Code" buildaction="Compile" />
+ <File name="Hyena.Data.Query/QueryField.cs" subtype="Code" buildaction="Compile" />
+ <File name="Hyena.Data.Query/UserQueryParser.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
Modified: trunk/banshee/src/Core/Hyena/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Hyena/Makefile.am (original)
+++ trunk/banshee/src/Core/Hyena/Makefile.am Thu Jan 10 20:59:39 2008
@@ -12,13 +12,13 @@
Hyena.CommandLine/LayoutGroup.cs \
Hyena.CommandLine/LayoutGroupAttribute.cs \
Hyena.CommandLine/LayoutOption.cs \
- Hyena.Data.Query/UserQueryParser.cs \
Hyena.Data.Query/QueryField.cs \
Hyena.Data.Query/QueryListNode.cs \
Hyena.Data.Query/QueryNode.cs \
Hyena.Data.Query/QueryParser.cs \
Hyena.Data.Query/QueryTermNode.cs \
Hyena.Data.Query/QueryToken.cs \
+ Hyena.Data.Query/UserQueryParser.cs \
Hyena.Data/CacheableModelAdapter.cs \
Hyena.Data/ColumnDescription.cs \
Hyena.Data/ICacheableModel.cs \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]