[gnome-music/wip/jfelder/open-audio-files: 14/18] coresong: Add is_filesystem property




commit 01755a6e02be2a2108552169fe30b9b23be57690
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 585f28e8d..56a08b745 100644
--- a/gnomemusic/coresong.py
+++ b/gnomemusic/coresong.py
@@ -84,6 +84,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)
         self.update_shuffle_pos()
@@ -97,6 +98,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]