Skip to content

Commit

Permalink
Ask for deleting a record although it could not be stopped properly i…
Browse files Browse the repository at this point in the history
…n TSR

Address #62
  • Loading branch information
Pavion committed Feb 19, 2023
1 parent 550a4c7 commit 4dee5ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/tsrplugin/TsrPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,15 @@ protected void deleteFromTSR(Program program) {
String urlParameters = String.format("uniqueid=%s", program.getUniqueID());
String response = connectTsr(url, urlParameters);

if (response.contains("true")) {
program.unmark(this);
getTsrList();
} else {
String msg = mLocalizer.msg( "deleteError" ,"Event '{}' could not be stopped" ).replace("{}", program.getTitle());
JOptionPane.showMessageDialog(this.getParentFrame(), msg, "Error", JOptionPane.ERROR_MESSAGE);
if (response.contains("false")) {
String msg = mLocalizer.msg( "deleteError" ,"Event '{}' could not be stopped in tvstreamrecord, should it be removed anyway?" ).replace("{}", program.getTitle());
String title = mLocalizer.msg( "deleteErrorTitle" ,"Event not found" );
if (JOptionPane.showConfirmDialog(this.getParentFrame(), msg, title, JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {
return;
}
}

program.unmark(this);
getTsrList();
}

protected String connectTsr(String url, String urlParameters) {
Expand Down
3 changes: 2 additions & 1 deletion src/tsrplugin/tsrplugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ TsrPlugin.pluginDesc = Remote control for TVStreamRecord, a Synology rec
TsrPlugin.urlMessage = TVStreamRecord URL and Port (e.g. http://0.0.0.0:8030)
TsrPlugin.menuOpen = Open TVStreamRecord
TsrPlugin.channelError = Channel '{}' could not be found in tvstreamrecord
TsrPlugin.deleteError = Event '{}' could not be stopped
TsrPlugin.deleteError = Event '{}' could not be stopped in tvstreamrecord, should it be removed anyway?
TsrPlugin.deleteErrorTitle = Event not found
TsrPlugin.connectionError = tvstreamrecord is not responding, please check your settings
3 changes: 2 additions & 1 deletion src/tsrplugin/tsrplugin_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ TsrPlugin.pluginDesc = Fernsteuerung f\u00fcr Aufnahmen mit TVStreamReco
TsrPlugin.urlMessage = TVStreamRecord URL und Port (z.B. http://0.0.0.0:8030)
TsrPlugin.menuOpen = TVStreamRecord aufrufen
TsrPlugin.channelError = Sender '{}' konnte in tvstreamrecord nicht gefunden werden
TsrPlugin.deleteError = Aufnahme '{}' konnte nicht gestoppt werden
TsrPlugin.deleteError = Aufnahme '{}' konnte in tvstreamrecord nicht gestoppt werden, sollte sie dennoch gel\u00f6scht werden?
TsrPlugin.deleteErrorTitle = Aufnahme nicht gefunden
TsrPlugin.connectionError = tvstreamrecord reagiert nicht, bitte \u00fcberpr\u00fcfen Sie Ihre Einstellungen

1 comment on commit 4dee5ba

@Pavion
Copy link
Owner Author

@Pavion Pavion commented on 4dee5ba Feb 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.