db: Track.path should return a Pathlib.Path

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-08-24 16:19:38 -04:00
parent a47e9e9fe9
commit 3fb6f3a2ba
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class TestTrackTable(unittest.TestCase):
self.assertEqual(track.lastplayed, None)
self.assertEqual(track.length, 1.234)
self.assertEqual(track.title, "Test Title")
self.assertEqual(track.path, "/a/b/c/d.efg")
self.assertEqual(track.path, pathlib.Path("/a/b/c/d.efg"))
with self.assertRaises(sqlite3.IntegrityError):
db.track.Table.insert(library, artist, album, disc, year,

View File

@ -75,7 +75,7 @@ class Track(objects.Row):
@GObject.Property
def path(self):
return self.get_column("path")
return pathlib.Path(self.get_column("path"))
def played(self):
execute("UPDATE tracks "