|
767 | 767 | favoriteButton.selected = true |
768 | 768 | end if |
769 | 769 | end if |
| 770 | + else if btn.id = "deleteButton" |
| 771 | + print "deleteButton pressed" |
| 772 | + if isValid(group) and isValid(group.itemContent) and isValid(group.itemContent.json) |
| 773 | + m.pendingDeleteItemId = group.itemContent.json.id |
| 774 | + m.global.sceneManager.callFunc("optionDialog", tr("Delete"), [tr("Are you sure you want to delete this item? This action cannot be undone.")], [tr("Cancel"), tr("Delete")]) |
| 775 | + end if |
770 | 776 | else if btn.id = "playAll" |
771 | 777 | print "playAll button pressed" |
772 | 778 | ' User has selected playlist of of audio they want us to play |
|
959 | 965 | popupNode = msg.getRoSGNode() |
960 | 966 | stopLoadingSpinner() |
961 | 967 | if isValid(popupNode) and isValid(popupNode.returnData) |
962 | | - selectedItem = m.global.queueManager.callFunc("getHold") |
963 | | - m.global.queueManager.callFunc("clearHold") |
964 | | - |
965 | | - if isValidAndNotEmpty(selectedItem) and isValid(selectedItem[0]) |
966 | | - if popupNode.returnData.indexselected = 0 |
967 | | - 'Resume video from resume point |
968 | | - startLoadingSpinner() |
969 | | - startingPoint = 0 |
970 | | - |
971 | | - if isValid(selectedItem[0].UserData) and isValid(selectedItem[0].UserData.PlaybackPositionTicks) |
972 | | - if selectedItem[0].UserData.PlaybackPositionTicks > 0 |
973 | | - startingPoint = selectedItem[0].UserData.PlaybackPositionTicks |
| 968 | + print "popupNode.returnData = ", popupNode.returnData |
| 969 | + ' Handle delete confirmation dialog |
| 970 | + if isValid(m.pendingDeleteItemId) |
| 971 | + if popupNode.returnData.indexSelected = 1 and popupNode.returnData.buttonSelected = tr("Delete") |
| 972 | + ' User confirmed deletion |
| 973 | + api.items.DeleteByID(m.pendingDeleteItemId) |
| 974 | + m.pendingDeleteItemId = invalid |
| 975 | + m.global.sceneManager.callFunc("popScene") |
| 976 | + else |
| 977 | + ' User cancelled or dialog closed |
| 978 | + m.pendingDeleteItemId = invalid |
| 979 | + end if |
| 980 | + else |
| 981 | + selectedItem = m.global.queueManager.callFunc("getHold") |
| 982 | + m.global.queueManager.callFunc("clearHold") |
| 983 | + |
| 984 | + if isValidAndNotEmpty(selectedItem) and isValid(selectedItem[0]) |
| 985 | + if popupNode.returnData.indexselected = 0 |
| 986 | + 'Resume video from resume point |
| 987 | + startLoadingSpinner() |
| 988 | + startingPoint = 0 |
| 989 | + |
| 990 | + if isValid(selectedItem[0].UserData) and isValid(selectedItem[0].UserData.PlaybackPositionTicks) |
| 991 | + if selectedItem[0].UserData.PlaybackPositionTicks > 0 |
| 992 | + startingPoint = selectedItem[0].UserData.PlaybackPositionTicks |
| 993 | + end if |
974 | 994 | end if |
975 | | - end if |
976 | 995 |
|
977 | | - selectedItem[0].startingPoint = startingPoint |
978 | | - m.global.queueManager.callFunc("clear") |
979 | | - m.global.queueManager.callFunc("push", selectedItem[0]) |
980 | | - m.global.queueManager.callFunc("playQueue") |
981 | | - else if popupNode.returnData.indexselected = 1 |
982 | | - 'Start Over from beginning selected, set position to 0 |
983 | | - startLoadingSpinner() |
984 | | - selectedItem[0].startingPoint = 0 |
985 | | - m.global.queueManager.callFunc("clear") |
986 | | - m.global.queueManager.callFunc("push", selectedItem[0]) |
987 | | - m.global.queueManager.callFunc("playQueue") |
988 | | - else if popupNode.returnData.indexselected = 2 |
989 | | - ' User chose Go to series |
990 | | - CreateSeriesDetailsGroup(selectedItem[0].SeriesId) |
991 | | - else if popupNode.returnData.indexselected = 3 |
992 | | - ' User chose Go to season |
993 | | - if isValid(selectedItem[0].SeriesId) and isValid(selectedItem[0].seasonID) |
994 | | - CreateSeasonDetailsGroupByID(selectedItem[0].SeriesId, selectedItem[0].seasonID) |
995 | | - else |
996 | | - stopLoadingSpinner() |
997 | | - message_dialog(tr("Error loading Season")) |
| 996 | + selectedItem[0].startingPoint = startingPoint |
| 997 | + m.global.queueManager.callFunc("clear") |
| 998 | + m.global.queueManager.callFunc("push", selectedItem[0]) |
| 999 | + m.global.queueManager.callFunc("playQueue") |
| 1000 | + else if popupNode.returnData.indexselected = 1 |
| 1001 | + 'Start Over from beginning selected, set position to 0 |
| 1002 | + startLoadingSpinner() |
| 1003 | + selectedItem[0].startingPoint = 0 |
| 1004 | + m.global.queueManager.callFunc("clear") |
| 1005 | + m.global.queueManager.callFunc("push", selectedItem[0]) |
| 1006 | + m.global.queueManager.callFunc("playQueue") |
| 1007 | + else if popupNode.returnData.indexselected = 2 |
| 1008 | + ' User chose Go to series |
| 1009 | + CreateSeriesDetailsGroup(selectedItem[0].SeriesId) |
| 1010 | + else if popupNode.returnData.indexselected = 3 |
| 1011 | + ' User chose Go to season |
| 1012 | + if isValid(selectedItem[0].SeriesId) and isValid(selectedItem[0].seasonID) |
| 1013 | + CreateSeasonDetailsGroupByID(selectedItem[0].SeriesId, selectedItem[0].seasonID) |
| 1014 | + else |
| 1015 | + stopLoadingSpinner() |
| 1016 | + message_dialog(tr("Error loading Season")) |
| 1017 | + end if |
| 1018 | + else if popupNode.returnData.indexselected = 4 |
| 1019 | + ' User chose Go to episode |
| 1020 | + CreateMovieDetailsGroup(selectedItem[0]) |
998 | 1021 | end if |
999 | | - |
1000 | | - else if popupNode.returnData.indexselected = 4 |
1001 | | - ' User chose Go to episode |
1002 | | - CreateMovieDetailsGroup(selectedItem[0]) |
1003 | 1022 | end if |
1004 | 1023 | end if |
1005 | 1024 | end if |
|
0 commit comments