mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 00:11:59 +02:00
Use custom getUriProtocol function
Gst.Uri.get_protocol function is very simple. It just splits string by ":" and return the first part. We can do the same in JS and by doing that we do not have to initialize GStreamer just to get this function.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const { Gdk, GLib, GObject, Gst, Gtk, Pango } = imports.gi;
|
||||
const { Gdk, GLib, GObject, Gtk, Pango } = imports.gi;
|
||||
const Debug = imports.src.debug;
|
||||
const Misc = imports.src.misc;
|
||||
|
||||
const { debug, warn } = Debug;
|
||||
|
||||
@@ -245,7 +246,7 @@ class ClapperPlaylistItem extends Gtk.ListBoxRow
|
||||
this.isLocalFile = false;
|
||||
|
||||
let filename;
|
||||
if(Gst.Uri.get_protocol(uri) === 'file') {
|
||||
if(Misc.getUriProtocol(uri) === 'file') {
|
||||
filename = GLib.path_get_basename(
|
||||
GLib.filename_from_uri(uri)[0]
|
||||
);
|
||||
|
Reference in New Issue
Block a user