Author: jwilcox
Date: 2005-07-05 16:51:19 -0400 (Tue, 05 Jul 2005)
New Revision: 46971

Modified:
   trunk/ipod-sharp/ChangeLog
   trunk/ipod-sharp/src/Song.cs
   trunk/ipod-sharp/src/SongDatabase.cs
   trunk/ipod-sharp/tests/IPodTests.cs
Log:
2005-07-05  James Willcox  <[EMAIL PROTECTED]>

        * src/Song.cs: add a 'PodcastUrl' property.
        * test/IPodTests.cs: add a test for the above


Modified: trunk/ipod-sharp/ChangeLog
===================================================================
--- trunk/ipod-sharp/ChangeLog  2005-07-05 20:40:09 UTC (rev 46970)
+++ trunk/ipod-sharp/ChangeLog  2005-07-05 20:51:19 UTC (rev 46971)
@@ -1,5 +1,10 @@
 2005-07-05  James Willcox  <[EMAIL PROTECTED]>
 
+       * src/Song.cs: add a 'PodcastUrl' property.
+       * test/IPodTests.cs: add a test for the above
+
+2005-07-05  James Willcox  <[EMAIL PROTECTED]>
+
        * src/SongDatabase.cs: support the newest database version with all the
        podcast stuff.  The special podcast playlist is not exposed yet in the
        public API.

Modified: trunk/ipod-sharp/src/Song.cs
===================================================================
--- trunk/ipod-sharp/src/Song.cs        2005-07-05 20:40:09 UTC (rev 46970)
+++ trunk/ipod-sharp/src/Song.cs        2005-07-05 20:51:19 UTC (rev 46971)
@@ -171,6 +171,11 @@
             set { record.Rating = (byte) value; }
         }
 
+        public string PodcastUrl {
+            get { return record.GetDetail (DetailType.PodcastUrl).Value; }
+            set { record.GetDetail (DetailType.PodcastUrl).Value = value; }
+        }
+
         internal SongDatabase Database {
             get { return db; }
         }

Modified: trunk/ipod-sharp/src/SongDatabase.cs
===================================================================
--- trunk/ipod-sharp/src/SongDatabase.cs        2005-07-05 20:40:09 UTC (rev 
46970)
+++ trunk/ipod-sharp/src/SongDatabase.cs        2005-07-05 20:51:19 UTC (rev 
46971)
@@ -390,6 +390,9 @@
             if ((int) Type < 50) {
                 if (Type == DetailType.PodcastUrl ||
                     Type == DetailType.PodcastUrl2) {
+
+                    // force it to the 'first' podcast url type
+                    Type = DetailType.PodcastUrl;
                     Value = Encoding.UTF8.GetString (body, 12, body.Length - 
12);
                 } else if (Type == DetailType.ChapterData) {
                     // ugh ugh ugh, just preserve it for now -- no parsing

Modified: trunk/ipod-sharp/tests/IPodTests.cs
===================================================================
--- trunk/ipod-sharp/tests/IPodTests.cs 2005-07-05 20:40:09 UTC (rev 46970)
+++ trunk/ipod-sharp/tests/IPodTests.cs 2005-07-05 20:51:19 UTC (rev 46971)
@@ -159,6 +159,7 @@
             song.PlayCount = 34;
             song.LastPlayed = now;
             song.Rating = SongRating.Four;
+            song.PodcastUrl = "blah blah";
 
             db.Save ();
             db.Reload ();
@@ -179,6 +180,7 @@
             Assert.AreEqual ("வணக்கம்", song.Comment);
             Assert.AreEqual (34, song.PlayCount);
             Assert.AreEqual (SongRating.Four, song.Rating);
+            Assert.AreEqual ("blah blah", song.PodcastUrl);
 
             // the conversion to/from mac time skews this a little
             // so we can't do a straight comparison

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to