(trackId)
| 864 | } |
| 865 | |
| 866 | function restoreTrackFromTrash(trackId) { |
| 867 | if (!tracks[trackId]) return; |
| 868 | const trash = getTrashFolder(); |
| 869 | if (!trash?.items.includes(trackId)) return; |
| 870 | trash.items = trash.items.filter((id) => id !== trackId); |
| 871 | let target = folders.find((f) => f.id !== TRASH_ID); |
| 872 | if (!target) { |
| 873 | target = makeFolder({ id: "f-unsorted", name: "Unsorted" }); |
| 874 | folders.unshift(target); |
| 875 | } |
| 876 | if (!target.items.includes(trackId)) target.items.push(trackId); |
| 877 | saveState(); |
| 878 | render(); |
| 879 | } |
| 880 | |
| 881 | function wireRailLibraryDrop() { |
| 882 | const btn = document.querySelector(".rail-library"); |
no test coverage detected