mirror of
https://github.com/JohnDoee/deluge-streaming/
synced 2026-07-01 07:31:17 -07:00
restructured plugin
This commit is contained in:
@@ -68,6 +68,18 @@ PreferencePage = Ext.extend(Ext.Panel, {
|
||||
fieldLabel: 'IP'
|
||||
}));
|
||||
|
||||
om.bind('use_stream_urls', fieldset.add({
|
||||
xtype: 'checkbox',
|
||||
name: 'use_stream_urls',
|
||||
fieldLabel: 'Use StreamProtocol urls',
|
||||
}));
|
||||
|
||||
om.bind('auto_open_stream_urls', fieldset.add({
|
||||
xtype: 'checkbox',
|
||||
name: 'auto_open_stream_urls',
|
||||
fieldLabel: 'AutoOpen StreamProtocol urls',
|
||||
}));
|
||||
|
||||
om.bind('reset_complete', fieldset.add({
|
||||
xtype: 'checkbox',
|
||||
name: 'reset_complete',
|
||||
@@ -150,10 +162,19 @@ StreamingPlugin = Ext.extend(Deluge.Plugin, {
|
||||
var fileIndex = nodes[0].attributes.fileIndex;
|
||||
var tid = files.torrentId;
|
||||
if (fileIndex >= 0) {
|
||||
deluge.client.streaming.stream_torrent(tid, fileIndex, {
|
||||
deluge.client.streaming.stream_torrent(tid, null, null, fileIndex, {
|
||||
success: function (result) {
|
||||
console.log('Got result', result);
|
||||
if (result.status == 'success') {
|
||||
Ext.Msg.alert('Stream ready', 'URL for stream: <a target="_blank" href="' + result.url + '">' + result.url + '</a>');
|
||||
var url = result.url;
|
||||
if (result.use_stream_urls) {
|
||||
url = 'stream+' + url;
|
||||
if (result.auto_open_stream_urls) {
|
||||
window.location.assign(url);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Ext.Msg.alert('Stream ready', 'URL for stream: <a target="_blank" href="' + url + '">' + url + '</a>');
|
||||
} else {
|
||||
Ext.Msg.alert('Stream failed', 'Error message: ' + result.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user