banshee r3701 - in trunk/banshee: . libbanshee src/Backends/Banshee.GStreamer/Banshee.GStreamer src/Core/Banshee.Core/Banshee.Collection src/Core/Banshee.Core/Banshee.Streaming src/Core/Banshee.Services/Banshee.Collection.Database src/Extensions/Banshee.AudioCd/Banshee.AudioCd
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3701 - in trunk/banshee: . libbanshee src/Backends/Banshee.GStreamer/Banshee.GStreamer src/Core/Banshee.Core/Banshee.Collection src/Core/Banshee.Core/Banshee.Streaming src/Core/Banshee.Services/Banshee.Collection.Database src/Extensions/Banshee.AudioCd/Banshee.AudioCd
- Date: Mon, 7 Apr 2008 04:15:53 +0100 (BST)
Author: abock
Date: Mon Apr 7 04:15:52 2008
New Revision: 3701
URL: http://svn.gnome.org/viewvc/banshee?rev=3701&view=rev
Log:
2008-04-06 Aaron Bockover <abock gnome org>
This commit functionally complete ripping. Ripped albums will now show
up in the library with all the metadata properly stored and organized.
There are now only a few things to polish regarding ripping.
* libbanshee/banshee-ripper.c: Removed a bad unref call - the pipeline
should only be unreffed when destroying it
* src/Backends/Banshee.GStreamer/Banshee.GStreamer/TagList.cs: Merge
release date, and musicbrainz ID properties into the tag list
* src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs: Added Release
Date and MusicBrainzId properties
* src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs:
* src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs: Added
MusicBrainzId properties
* src/Core/Banshee.Core/Banshee.Streaming/CommonTags.cs: Added GStreamer
tag names for MusicBrainz
* 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:
Bind MusicBrainzId properties to respective database columns so these
are now stored/loaded properly
* src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs:
Support saving a lot of extra information from MusicBrainz and properly
create the album, artist, and album artist records
* src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs:
Save the track, artist, and album artist records into the database
when a track finishes ripping
* src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdTrackInfo.cs:
Extend DatabaseTrackInfo and persist artist, album, and album artist
objects on the track which can be saved to the database when ripped
Modified:
trunk/banshee/ChangeLog
trunk/banshee/libbanshee/banshee-ripper.c
trunk/banshee/src/Backends/Banshee.GStreamer/Banshee.GStreamer/TagList.cs
trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs
trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs
trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
trunk/banshee/src/Core/Banshee.Core/Banshee.Streaming/CommonTags.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs
trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs
trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdTrackInfo.cs
Modified: trunk/banshee/libbanshee/banshee-ripper.c
==============================================================================
--- trunk/banshee/libbanshee/banshee-ripper.c (original)
+++ trunk/banshee/libbanshee/banshee-ripper.c Mon Apr 7 04:15:52 2008
@@ -154,7 +154,6 @@
case GST_MESSAGE_EOS: {
gst_element_set_state (GST_ELEMENT (ripper->pipeline), GST_STATE_NULL);
- g_object_unref (G_OBJECT (ripper->pipeline));
ripper->is_ripping = FALSE;
br_stop_iterate_timeout (ripper);
Modified: trunk/banshee/src/Backends/Banshee.GStreamer/Banshee.GStreamer/TagList.cs
==============================================================================
--- trunk/banshee/src/Backends/Banshee.GStreamer/Banshee.GStreamer/TagList.cs (original)
+++ trunk/banshee/src/Backends/Banshee.GStreamer/Banshee.GStreamer/TagList.cs Mon Apr 7 04:15:52 2008
@@ -58,11 +58,18 @@
AddTag (CommonTags.TrackNumber, (uint)track.TrackNumber);
AddTag (CommonTags.TrackCount, (uint)track.TrackCount);
AddTag (CommonTags.AlbumVolumeNumber, (uint)track.Disc);
+
AddYear (track.Year);
+ AddDate (track.ReleaseDate);
AddTag (CommonTags.Composer, track.Composer);
AddTag (CommonTags.Copyright, track.Copyright);
AddTag (CommonTags.Comment, track.Comment);
+
+ AddTag (CommonTags.MusicBrainzTrackId, track.MusicBrainzId);
+ AddTag (CommonTags.MusicBrainzArtistId, track.ArtistMusicBrainzId);
+ AddTag (CommonTags.MusicBrainzAlbumId, track.AlbumMusicBrainzId);
+
}
public void AddTag (string tagName, string value)
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 Mon Apr 7 04:15:52 2008
@@ -38,6 +38,8 @@
private string title;
private string artist_name;
private string artwork_id;
+ private DateTime release_date = DateTime.MinValue;
+ private string musicbrainz_id;
public AlbumInfo (string title)
{
@@ -54,6 +56,16 @@
set { title = value; }
}
+ public virtual string MusicBrainzId {
+ get { return musicbrainz_id; }
+ set { musicbrainz_id = value; }
+ }
+
+ public virtual DateTime ReleaseDate {
+ get { return release_date; }
+ set { release_date = value; }
+ }
+
public virtual string ArtworkId {
get {
if (artwork_id == null) {
Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs (original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs Mon Apr 7 04:15:52 2008
@@ -31,11 +31,17 @@
public class ArtistInfo
{
private string name;
+ private string musicbrainz_id;
public ArtistInfo(string name)
{
this.name = name;
}
+
+ public virtual string MusicBrainzId {
+ get { return musicbrainz_id; }
+ set { musicbrainz_id = value; }
+ }
public virtual string Name {
get { return name; }
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 Mon Apr 7 04:15:52 2008
@@ -52,6 +52,7 @@
private string composer;
private string copyright;
private string license_uri;
+ private string musicbrainz_id;
private string comment;
private int track_number;
@@ -61,6 +62,7 @@
private int rating;
private TimeSpan duration;
+ private DateTime release_date;
private DateTime date_added;
private int play_count;
@@ -149,6 +151,24 @@
set { track_title = value; }
}
+ public virtual string MusicBrainzId {
+ get { return musicbrainz_id; }
+ set { musicbrainz_id = value; }
+ }
+
+ public virtual string ArtistMusicBrainzId {
+ get { return null; }
+ }
+
+ public virtual string AlbumMusicBrainzId {
+ get { return null; }
+ }
+
+ public virtual DateTime ReleaseDate {
+ get { return release_date; }
+ set { release_date = value; }
+ }
+
public string DisplayArtistName {
get {
string name = ArtistName == null ? null : ArtistName.Trim ();
Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Streaming/CommonTags.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Streaming/CommonTags.cs (original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Streaming/CommonTags.cs Mon Apr 7 04:15:52 2008
@@ -73,5 +73,9 @@
public const string StreamType = "stream-type";
public const string AlbumCoverId = "album-cover-id";
public const string MoreInfoUri = "more-info-uri";
+ public const string MusicBrainzTrackId = "musicbrainz-trackid";
+ public const string MusicBrainzArtistId = "musicbrainz-artistid";
+ public const string MusicBrainzAlbumId = "musicbrainz-albumid";
+ public const string MusicBrainzDiscId = "musicbrainz-discid";
}
}
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 Mon Apr 7 04:15:52 2008
@@ -145,6 +145,18 @@
get { return artist_id; }
set { artist_id = value; }
}
+
+ [DatabaseColumn("MusicBrainzID")]
+ public override string MusicBrainzId {
+ get { return base.MusicBrainzId; }
+ set { base.MusicBrainzId = value; }
+ }
+
+ [DatabaseColumn]
+ public override DateTime ReleaseDate {
+ get { return base.ReleaseDate; }
+ set { base.ReleaseDate = value; }
+ }
[DatabaseColumn]
public override string Title {
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs Mon Apr 7 04:15:52 2008
@@ -136,6 +136,12 @@
get { return base.Name; }
set { base.Name = value; }
}
+
+ [DatabaseColumn("MusicBrainzID")]
+ public override string MusicBrainzId {
+ get { return base.MusicBrainzId; }
+ set { base.MusicBrainzId = value; }
+ }
[DatabaseColumn(Select = false)]
protected string NameLowered {
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 Mon Apr 7 04:15:52 2008
@@ -109,7 +109,7 @@
get { return DatabaseArtistInfo.FindOrCreate (ArtistName); }
}
- public DatabaseAlbumInfo Album{
+ public DatabaseAlbumInfo Album {
get { return DatabaseAlbumInfo.FindOrCreate (Artist, AlbumTitle); }
}
@@ -205,11 +205,10 @@
set { tag_set_id = value; }
}
- private string music_brainz_id;
- [DatabaseColumn]
- public string MusicBrainzID {
- get { return music_brainz_id; }
- set { music_brainz_id = value; }
+ [DatabaseColumn ("MusicBrainzID")]
+ public override string MusicBrainzId {
+ get { return base.MusicBrainzId; }
+ set { base.MusicBrainzId = value; }
}
public override SafeUri Uri {
Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs Mon Apr 7 04:15:52 2008
@@ -38,6 +38,7 @@
using Banshee.Base;
using Banshee.Hardware;
using Banshee.Collection;
+using Banshee.Collection.Database;
namespace Banshee.AudioCd
{
@@ -105,7 +106,7 @@
OnMetadataQueryFinished (false);
return;
}
-
+
disc_title = release.Title;
int disc_number = 1;
@@ -135,20 +136,36 @@
ApplicationContext.InternalCultureInfo);
}
+ DatabaseArtistInfo artist = new DatabaseArtistInfo ();
+ artist.Name = release.Artist.Name;
+ artist.MusicBrainzId = release.Artist.Id;
+
+ DatabaseAlbumInfo album = new DatabaseAlbumInfo ();
+ album.Title = release.Title;
+ album.ArtistName = artist.Name;
+ album.MusicBrainzId = release.Id;
+ album.ReleaseDate = release_date;
+
i = 0;
foreach (Track track in release.Tracks) {
- this[i].TrackTitle = track.Title;
- this[i].ArtistName = track.Artist.Name;
- this[i].AlbumTitle = release.Title;
- this[i].Disc = disc_number;
+ AudioCdTrackInfo model_track = (AudioCdTrackInfo)this[i++];
+
+ model_track.MusicBrainzId = track.Id;
+ model_track.TrackTitle = track.Title;
+ model_track.ArtistName = track.Artist.Name;
+ model_track.AlbumTitle = release.Title;
+ model_track.Disc = disc_number;
+
+ model_track.Album = album;
+ model_track.AlbumArtist = artist;
+ model_track.Artist = new DatabaseArtistInfo ();
+ model_track.Artist.Name = track.Artist.Name;
+ model_track.Artist.MusicBrainzId = track.Artist.Id;
if (!release_date.Equals (DateTime.MinValue)) {
- // FIXME: We need to change the Year column to a Release Date column
- this[i].Year = release_date.Year;
+ model_track.Year = release_date.Year;
}
-
- i++;
}
OnMetadataQueryFinished (true);
Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs Mon Apr 7 04:15:52 2008
@@ -35,6 +35,7 @@
using Banshee.Base;
using Banshee.ServiceStack;
using Banshee.Collection;
+using Banshee.Collection.Database;
using Banshee.MediaEngine;
namespace Banshee.AudioCd
@@ -190,9 +191,26 @@
return;
}
- ripped_duration += args.Track.Duration;
- args.Track.Uri = args.Uri;
- source.UnlockTrack ((AudioCdTrackInfo)args.Track);
+ AudioCdTrackInfo track = (AudioCdTrackInfo)args.Track;
+
+ ripped_duration += track.Duration;
+ track.PrimarySource = ServiceManager.SourceManager.MusicLibrary;
+ track.Uri = args.Uri;
+
+ if (track.Artist != null) {
+ track.Artist = DatabaseArtistInfo.UpdateOrCreate (track.Artist);
+ track.ArtistId = track.Artist.DbId;
+ }
+
+ if (track.Album != null && track.AlbumArtist != null) {
+ DatabaseArtistInfo.UpdateOrCreate (track.AlbumArtist);
+ track.Album = DatabaseAlbumInfo.UpdateOrCreate (track.AlbumArtist, track.Album);
+ track.AlbumId = track.Album.DbId;
+ }
+
+ track.Save ();
+
+ source.UnlockTrack (track);
RipNextTrack ();
}
Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdTrackInfo.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdTrackInfo.cs Mon Apr 7 04:15:52 2008
@@ -30,10 +30,11 @@
using Banshee.Base;
using Banshee.Collection;
+using Banshee.Collection.Database;
namespace Banshee.AudioCd
{
- public class AudioCdTrackInfo : TrackInfo
+ public class AudioCdTrackInfo : DatabaseTrackInfo
{
public AudioCdTrackInfo (AudioCdDiscModel model, string deviceNode, int index)
{
@@ -53,6 +54,43 @@
get { return index_on_disc; }
}
+ public DatabaseArtistInfo album_artist_info;
+ public DatabaseArtistInfo AlbumArtist {
+ get { return album_artist_info; }
+ set { album_artist_info = value; }
+ }
+
+ private DatabaseAlbumInfo album_info;
+ public new DatabaseAlbumInfo Album {
+ get { return album_info; }
+ set { album_info = value; }
+ }
+
+ public DatabaseArtistInfo artist_info;
+ public new DatabaseArtistInfo Artist {
+ get { return artist_info; }
+ set { artist_info = value; }
+ }
+
+ public override string AlbumMusicBrainzId {
+ get { return Album == null ? null : Album.MusicBrainzId; }
+ }
+
+ public override string ArtistMusicBrainzId {
+ get { return Artist == null ? null : Artist.MusicBrainzId; }
+ }
+
+ public override DateTime ReleaseDate {
+ get { return Album == null ? base.ReleaseDate : Album.ReleaseDate; }
+ set {
+ if (Album == null) {
+ base.ReleaseDate = value;
+ } else {
+ Album.ReleaseDate = value;
+ }
+ }
+ }
+
private bool rip_enabled = true;
public bool RipEnabled {
get { return rip_enabled; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]