import{I as E}from"./IdnodeGrid-U6EqXqja.js";import{A as R}from"./ActionMenu-B3aKIJFu.js";import{j as r,d as S,u as x,a as A,e as C,f as s,g as p,h as e,I,F as M,k as T,o as V,i as B,t as L,s as P,_ as U}from"./index-D92x6h1h.js";import{u as a}from"./useBulkAction-UV8yZtrd.js";import{u as z,d as G}from"./dvrEntryColumns-BRmCkPKX.js";import{f as N}from"./predicates-CyAX7uX3.js";import{c as j}from"./dvrToolbarHelpers-C5M0Cokf.js";import{a as H}from"./dvrFieldDefs-BDfuZvpU.js";import"./DataGrid-CbtTsx8d.js";import"./index-BG9mM10J.js";import"./index-7HNOjfAo.js";import"./localDay-CoEbUe3O.js";import"./SearchInput-DBHWpJgW.js";import"./useGridLayout-DCIiMD42.js";import"./CollapsibleSection.vue_vue_type_style_index_0_lang-Cq2AVc9p.js";import"./sliders-horizontal-Am8f4Xsv.js";import"./useStaleDataRecovery-BuNK-94T.js";import"./useEditorMode-DvyB-mon.js";import"./BooleanCell-BFiLlZVv.js";/* empty css                                                                      */import"./EnumNameCell-BjJ4chu_.js";function O(o){const t=!N(o.selection);return[...j(o),{id:"move",label:o.moving?r("Moving…"):r("Move to finished"),tooltip:r("Mark the selected recording as finished"),disabled:o.selection.length===0||o.moving,onClick:()=>o.onMoveToFinished(o.selection,o.clearSelection)},{id:"download",label:r("Download"),tooltip:r("Download the selected recording"),disabled:o.selection.length!==1||t,onClick:()=>o.onDownload(o.selection)}]}const $={class:"failed__empty"},q=S({__name:"FailedView",setup(o){const{t}=x(),g=A(),d=T(()=>g.data?.admin?"playcount,retention,removal,owner,comment":"retention,removal,comment"),{kodiFmt:v,editingUuid:_,editingUuids:h,gridRef:y,editorLevel:w,openEditor:c,closeEditor:F}=z({editList:d,urlSync:!0}),b=G(v,{status:!0,filesize:!0,playcount:!0,filename:!0,phoneFields:["status"]}),u=a({endpoint:"idnode/delete",confirmText:t(`Do you really want to delete the selected recordings?

The associated file will be removed from storage.`),confirmSeverity:"danger",failPrefix:t("Failed to delete")}),m=a({endpoint:"dvr/entry/rerecord/toggle",failPrefix:t("Failed to toggle re-record")}),f=a({endpoint:"dvr/entry/move/finished",failPrefix:t("Failed to move to finished")});function k(n){if(n.length===0)return;const i=n[0].uuid;typeof i!="string"||!i||globalThis.open(P(`dvrfile/${i}`),"_blank")}return(n,i)=>(V(),C(M,null,[s(E,{ref_key:"gridRef",ref:y,endpoint:"dvr/entry/grid_failed","help-page":"class/dvrentry",columns:e(b),"store-key":"dvr-failed","default-sort":{key:"start_real",dir:"DESC"},"virtual-scroller-options":{itemSize:36,lazy:!1},"count-label":"recordings","groupable-fields":e(H),class:"failed__grid",onRowDblclick:i[0]||(i[0]=l=>e(c)([l]))},{empty:p(()=>[B("p",$,L(e(t)("No failed recordings.")),1)]),toolbarActions:p(({selection:l,clearSelection:D})=>[s(R,{actions:e(O)({selection:l,clearSelection:D,deleting:e(u).inflight.value,rerecording:e(m).inflight.value,moving:e(f).inflight.value,onEdit:e(c),onDelete:e(u).run,onDownload:k,onRerecord:e(m).run,onMoveToFinished:e(f).run})},null,8,["actions"])]),_:1},8,["columns","groupable-fields"]),s(I,{uuid:e(_),uuids:e(h),level:e(w),list:d.value,title:e(t)("Edit Recording"),onClose:e(F)},null,8,["uuid","uuids","level","list","title","onClose"])],64))}}),pe=U(q,[["__scopeId","data-v-8aea7e16"]]);export{pe as default};
