mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Pass GioFiles from FileChooser instead of URIs
Otherwise they are converted back to GioFile to check their existance and back again to URI which is unefficient. This change avoids doing that.
This commit is contained in:
@@ -52,18 +52,17 @@ class ClapperFileChooser extends Gtk.FileChooserNative
|
||||
let playlist = [];
|
||||
|
||||
while((file = files.get_item(index))) {
|
||||
let uri = file.get_uri();
|
||||
let filename = file.get_basename();
|
||||
let [type, isUncertain] = Gio.content_type_guess(filename, null);
|
||||
|
||||
if(this.subsMimes.includes(type)) {
|
||||
subs = uri;
|
||||
subs = file;
|
||||
files.remove(index);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
playlist.push(uri);
|
||||
playlist.push(file);
|
||||
index++;
|
||||
}
|
||||
|
||||
|
@@ -156,8 +156,12 @@ class ClapperPlayer extends PlayerBase
|
||||
return this._playlist;
|
||||
}
|
||||
|
||||
set_subtitles(uri)
|
||||
set_subtitles(source)
|
||||
{
|
||||
let uri = (source.get_uri)
|
||||
? source.get_uri()
|
||||
: source;
|
||||
|
||||
this.set_subtitle_uri(uri);
|
||||
this.set_subtitle_track_enabled(true);
|
||||
|
||||
|
Reference in New Issue
Block a user