banshee r3534 - in trunk/banshee: . po src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Library
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3534 - in trunk/banshee: . po src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Library
- Date: Tue, 25 Mar 2008 15:59:09 +0000 (GMT)
Author: gburt
Date: Tue Mar 25 15:59:08 2008
New Revision: 3534
URL: http://svn.gnome.org/viewvc/banshee?rev=3534&view=rev
Log:
2008-03-25 Gabriel Burt <gabriel burt gmail com>
* src/Core/Banshee.Services/Banshee.Collection.Database/AlbumListDatabaseModel.cs:
* src/Core/Banshee.Services/Banshee.Collection.Database/ArtistListDatabaseModel.cs:
* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs:
* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs:
* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs:
* src/Core/Banshee.Services/Banshee.Collection.Database/LibraryArtistInfo.cs:
* src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs:
* src/Core/Banshee.Services/Banshee.Library/LibraryImportManager.cs:
* src/Core/Banshee.Services/Makefile.am: Rename LibraryArtistInfo class to
DatabaseArtistInfo.
Added:
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs (contents, props changed)
- copied, changed from r3531, /trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/LibraryArtistInfo.cs
Removed:
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/LibraryArtistInfo.cs
Modified:
trunk/banshee/ChangeLog
trunk/banshee/po/POTFILES.in
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/AlbumListDatabaseModel.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/ArtistListDatabaseModel.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibraryImportManager.cs
trunk/banshee/src/Core/Banshee.Services/Makefile.am
Modified: trunk/banshee/po/POTFILES.in
==============================================================================
--- trunk/banshee/po/POTFILES.in (original)
+++ trunk/banshee/po/POTFILES.in Tue Mar 25 15:59:08 2008
@@ -19,7 +19,7 @@
src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
src/Core/Banshee.Core/Banshee.Streaming/SaveTrackMetadataJob.cs
src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs
-src/Core/Banshee.Services/Banshee.Collection.Database/LibraryArtistInfo.cs
+src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs
src/Core/Banshee.Services/Banshee.Collection/ImportManager.cs
src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
src/Core/Banshee.Services/Banshee.Library/HomeDirectoryImportSource.cs
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/AlbumListDatabaseModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/AlbumListDatabaseModel.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/AlbumListDatabaseModel.cs Tue Mar 25 15:59:08 2008
@@ -124,11 +124,11 @@
set {
ModelHelper.BuildIdFilter<ArtistInfo> (value, "CoreAlbums.ArtistID", artist_id_filter_query,
delegate (ArtistInfo artist) {
- if (!(artist is LibraryArtistInfo)) {
+ if (!(artist is DatabaseArtistInfo)) {
return null;
}
- return ((LibraryArtistInfo)artist).DbId.ToString ();
+ return ((DatabaseArtistInfo)artist).DbId.ToString ();
},
delegate (string new_filter) {
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/ArtistListDatabaseModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/ArtistListDatabaseModel.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/ArtistListDatabaseModel.cs Tue Mar 25 15:59:08 2008
@@ -40,8 +40,8 @@
{
public class ArtistListDatabaseModel : ArtistListModel, ICacheableDatabaseModel
{
- private readonly BansheeModelProvider<LibraryArtistInfo> provider;
- private readonly BansheeModelCache<LibraryArtistInfo> cache;
+ private readonly BansheeModelProvider<DatabaseArtistInfo> provider;
+ private readonly BansheeModelCache<DatabaseArtistInfo> cache;
private readonly TrackListDatabaseModel track_model;
private string reload_fragment;
private long count;
@@ -50,8 +50,8 @@
public ArtistListDatabaseModel(BansheeDbConnection connection, string uuid)
{
- provider = LibraryArtistInfo.Provider;
- cache = new BansheeModelCache <LibraryArtistInfo> (connection, uuid, this, provider);
+ provider = DatabaseArtistInfo.Provider;
+ cache = new BansheeModelCache <DatabaseArtistInfo> (connection, uuid, this, provider);
cache.HasSelectAllItem = true;
Selection.Changed += HandleSelectionChanged;
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs Tue Mar 25 15:59:08 2008
@@ -58,7 +58,7 @@
ArtistName
}
- public static DatabaseAlbumInfo FindOrCreate (LibraryArtistInfo artist, string title)
+ public static DatabaseAlbumInfo FindOrCreate (DatabaseArtistInfo artist, string title)
{
DatabaseAlbumInfo album;
Copied: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs (from r3531, /trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/LibraryArtistInfo.cs)
==============================================================================
--- /trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/LibraryArtistInfo.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs Tue Mar 25 15:59:08 2008
@@ -1,5 +1,5 @@
//
-// LibraryArtistInfo.cs
+// DatabaseArtistInfo.cs
//
// Author:
// Aaron Bockover <abockover novell com>
@@ -38,13 +38,13 @@
namespace Banshee.Collection.Database
{
- public class LibraryArtistInfo : ArtistInfo, ICacheableItem
+ public class DatabaseArtistInfo : ArtistInfo, ICacheableItem
{
- private static BansheeModelProvider<LibraryArtistInfo> provider = new BansheeModelProvider<LibraryArtistInfo> (
+ private static BansheeModelProvider<DatabaseArtistInfo> provider = new BansheeModelProvider<DatabaseArtistInfo> (
ServiceManager.DbConnection, "CoreArtists"
);
- public static BansheeModelProvider<LibraryArtistInfo> Provider {
+ public static BansheeModelProvider<DatabaseArtistInfo> Provider {
get { return provider; }
}
@@ -57,18 +57,18 @@
Name
}
- public static LibraryArtistInfo FindOrCreate (string artistName)
+ public static DatabaseArtistInfo FindOrCreate (string artistName)
{
- LibraryArtistInfo artist;
+ DatabaseArtistInfo artist;
if (artistName == null || artistName.Trim () == String.Empty)
artistName = Catalog.GetString ("Unknown Artist");
using (IDataReader reader = ServiceManager.DbConnection.Query (select_command, artistName)) {
if (reader.Read ()) {
- artist = new LibraryArtistInfo (reader);
+ artist = new DatabaseArtistInfo (reader);
} else {
- artist = new LibraryArtistInfo ();
+ artist = new DatabaseArtistInfo ();
artist.Name = artistName;
artist.Save ();
}
@@ -76,11 +76,11 @@
return artist;
}
- public LibraryArtistInfo () : base (null)
+ public DatabaseArtistInfo () : base (null)
{
}
- protected LibraryArtistInfo (IDataReader reader) : base (null)
+ protected DatabaseArtistInfo (IDataReader reader) : base (null)
{
LoadFromReader (reader);
}
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs Tue Mar 25 15:59:08 2008
@@ -102,6 +102,12 @@
DateUpdated = DateTime.Now;
bool is_new = TrackId == 0;
Provider.Save (this);
+
+ // Pattern for saving artist / album:
+ // 1) if not dirty, ignore
+ // 2) if dirty, look up, update our id if found, otherwise create
+ // 3) delete unused ones
+
if (notify) {
if (is_new) {
PrimarySource.NotifyTracksAdded ();
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs Tue Mar 25 15:59:08 2008
@@ -376,11 +376,11 @@
set {
ModelHelper.BuildIdFilter<ArtistInfo> (value, "CoreTracks.ArtistID", artist_id_filter_query,
delegate (ArtistInfo artist) {
- if (!(artist is LibraryArtistInfo)) {
+ if (!(artist is DatabaseArtistInfo)) {
return null;
}
- return ((LibraryArtistInfo)artist).DbId.ToString ();
+ return ((DatabaseArtistInfo)artist).DbId.ToString ();
},
delegate (string new_filter) {
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibraryImportManager.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibraryImportManager.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibraryImportManager.cs Tue Mar 25 15:59:08 2008
@@ -135,7 +135,7 @@
track.Uri = newpath;
}
- LibraryArtistInfo artist = LibraryArtistInfo.FindOrCreate (track.ArtistName);
+ DatabaseArtistInfo artist = DatabaseArtistInfo.FindOrCreate (track.ArtistName);
DatabaseAlbumInfo album = DatabaseAlbumInfo.FindOrCreate (artist, track.AlbumTitle);
track.DateAdded = DateTime.Now;
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 Tue Mar 25 15:59:08 2008
@@ -13,8 +13,8 @@
Banshee.Collection.Database/AlbumListDatabaseModel.cs \
Banshee.Collection.Database/ArtistListDatabaseModel.cs \
Banshee.Collection.Database/DatabaseAlbumInfo.cs \
+ Banshee.Collection.Database/DatabaseArtistInfo.cs \
Banshee.Collection.Database/DatabaseTrackInfo.cs \
- Banshee.Collection.Database/LibraryArtistInfo.cs \
Banshee.Collection.Database/TrackListDatabaseModel.cs \
Banshee.Collection/AlbumListModel.cs \
Banshee.Collection/ArtistListModel.cs \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]