[gnome-music/wip/jfelder/open-audio-files: 3/8] coresong: Add is_filesystem property
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/open-audio-files: 3/8] coresong: Add is_filesystem property
- Date: Sun, 9 Jan 2022 23:29:46 +0000 (UTC)
commit d4159836d2ea485cd4a57edaad116a506349ebb0
Author: Jean Felder <jfelder src gnome org>
Date: Thu Dec 2 18:31:01 2021 +0100
coresong: Add is_filesystem property
This property checks if the coresong has been loaded by the Grilo
filesystem plugin.
This plugin will be introduced in a future commit.
gnomemusic/coresong.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/gnomemusic/coresong.py b/gnomemusic/coresong.py
index ad397960b..da03f6250 100644
--- a/gnomemusic/coresong.py
+++ b/gnomemusic/coresong.py
@@ -82,6 +82,7 @@ class CoreSong(GObject.GObject):
self.props.grlid = media.get_source() + media.get_id()
self._is_tracker: bool = media.get_source() == "grl-tracker3-source"
+ self._is_filesystem: bool = media.get_source() == "grl-filesystem"
self.props.validation = CoreSong.Validation.PENDING
self.update(media)
@@ -94,6 +95,17 @@ class CoreSong(GObject.GObject):
def is_tracker(self) -> bool:
return self._is_tracker
+ @GObject.Property(
+ type=bool, default=False, flags=GObject.ParamFlags.READABLE)
+ def is_filesystem(self) -> bool:
+ """This property checks if the coresong has been loaded
+ by the Grilo filesystem plugin.
+
+ :returns: True is the song comes from the Grilo filesystem
+ plugin
+ """
+ return self._is_filesystem
+
@GObject.Property(type=bool, default=False)
def favorite(self) -> bool:
return self._favorite
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]