]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui/dvr: Remove unused & duplicated functions
authorDavid Kalnischkies <david@kalnischkies.de>
Fri, 11 Aug 2023 05:28:37 +0000 (05:28 +0000)
committerFlole998 <Flole998@users.noreply.github.com>
Fri, 11 Aug 2023 23:33:57 +0000 (01:33 +0200)
While implementing the alternative/similar broadcast buttons it seems
like previous attempts remained in the final code but were either
unused (like `dvrAlternativeShowings` as the buttons are calling
 `epgAlternativeShowingsDialog` instead) or duplicate functions which
already existed like `load`, `previousEvent` & `nextEvent`.

References: 04cd487bb8

src/webui/static/app/dvr.js

index 8b703a97bb4d3636d41997feb1fabbb5006d1862..b3913fd4649e5d8022e6f4e6025d356024074fa4 100644 (file)
@@ -319,158 +319,6 @@ tvheadend.dvrDetails = function(grid, index) {
       });
   }                           // load
 
-  function previousEvent(b, e) {
-      --current_index;
-      load(store,current_index,updateit);
-  }
-  function nextEvent(b, e) {
-      ++current_index;
-      var cbWin = b.findParentByType(Ext.Window);
-      load(store,current_index,updateit);
-  }
-  function dvrAlternativeShowings(eventId) {
-      var store = getAlternativeShowingsStore(eventId);
-
-    var detailsfcn = function(grid, rec, act, row) {
-      var store = grid.getStore();
-      var event = store.getAt(row);
-      var data = event.data;
-        new tvheadend.epgDetails(grid, row);
-    };
-
-    var eventdetails = new Ext.ux.grid.RowActions({
-        id: 'details',
-        header: _('Details'),
-        tooltip: _('Details'),
-        width: 67,
-        dataIndex: 'actions',
-        callbacks: {
-            'recording':      detailsfcn,
-            'recordingError': detailsfcn,
-            'scheduled':      detailsfcn,
-            'completed':      detailsfcn,
-            'completedError': detailsfcn
-        },
-        actions: [
-            {
-                iconCls: 'broadcast_details',
-                qtip: _('Broadcast details'),
-                cb: detailsfcn
-            },
-            {
-                iconIndex: 'dvrState'
-            }
-        ]
-    });
-
-     var epgView = new Ext.ux.grid.livegrid.GridView({
-         nearLimit: 100,
-         loadMask: {
-             msg: _('Buffering. Please wait…')
-         },
- });
-
-    var grid = new Ext.ux.grid.livegrid.GridPanel({
-              store: store,
-              plugins: [eventdetails],
-              iconCls: 'epg',
-              view: epgView,
-              cm: new Ext.grid.ColumnModel({
-                columns: [
-                  eventdetails,
-                  {
-                    width: 250,
-                    id: 'title',
-                    header: _("Title"),
-                    tooltip: _("Title"),
-                    dataIndex: 'title',
-                  },
-                  {
-                    width: 250,
-                    id: 'extratext',
-                    header: _("Extra text"),
-                    tooltip: _("Extra text: subtitle or summary or description"),
-                    dataIndex: 'extratext',
-                    renderer: dvrRenderExtraText
-                  },
-                  {
-                    width: 200,
-                    id: 'start',
-                    header: _("Start Time"),
-                    tooltip: _("Start Time"),
-                    dataIndex: 'start',
-                    renderer: dvrRenderDate
-                  },
-            {
-                width: 200,
-                id: 'stop',
-                header: _("End Time"),
-                tooltip: _("End Time"),
-                dataIndex: 'stop',
-                renderer: dvrRenderDate
-            },
-            {
-                width: 250,
-                id: 'channelName',
-                header: _("Channel"),
-                tooltip: _("Channel"),
-                dataIndex: 'channelName',
-            },
-                ],
-              }),
-       });                      // grid
-
-
-       var windowHeight = Ext.getBody().getViewSize().height - 150;
-
-       win = new Ext.Window({
-            title: 'Alternative Showings',
-            iconCls: 'info',
-            layout: 'fit',
-            width: 1200,
-            height: windowHeight,
-            constrainHeader: true,
-            buttonAlign: 'center',
-            autoScroll: true,
-            items: grid,
-        });
-        // Handle comet updates until user closes dialog.
-        var update = function(m) {
-            tvheadend.epgCometUpdate(m, store);
-        };
-       tvheadend.comet.on('epg', update);
-       win.on('close', function(panel, opts) {
-           tvheadend.comet.un('epg', update);
-       });
-
-       win.show();
-       updateDialogFanart(d);
-       checkButtonAvailability(win.fbar)
-  }
-
-  function load(store, index, cb) {
-      var uuid = store.getAt(index).id;
-      tvheadend.loading(1);
-      Ext.Ajax.request({
-        url: 'api/idnode/load',
-        params: {
-            uuid: uuid,
-            list: 'channel_icon,disp_title,disp_subtitle,disp_summary,episode_disp,start_real,stop_real,' +
-                  'duration,disp_description,status,filesize,comment,duplicate,' +
-                  'autorec_caption,timerec_caption,image,copyright_year,credits,keyword,category,' +
-                  'first_aired,genre,channelname,fanart_image,broadcast',
-        },
-        success: function(d) {
-            d = json_decode(d);
-            tvheadend.loading(0),
-            cb(d);
-        },
-        failure: function(d) {
-            tvheadend.loading(0);
-        }
-      });
-  }                           // load
-
   function previousEvent() {
       --current_index;
       load(store,current_index,updateit);