* at least take language info from TryUploadSubtitles response

This commit is contained in:
Reinhard Pointner 2014-05-19 15:13:14 +00:00
parent 383a6922a5
commit 49b49b80b7
1 changed files with 17 additions and 6 deletions

View File

@ -578,6 +578,7 @@ public class SubtitleUploadDialog extends JDialog {
}
private Object identity;
private Object remoteIdentity;
private File subtitle;
private File video;
private Language language;
@ -596,6 +597,10 @@ public class SubtitleUploadDialog extends JDialog {
return identity;
}
public Object getRemoteIdentity() {
return remoteIdentity;
}
public File getSubtitle() {
return subtitle;
}
@ -622,6 +627,11 @@ public class SubtitleUploadDialog extends JDialog {
firePropertyChange("identity", null, this.identity);
}
public void setRemoteIdentity(Object identity) {
this.remoteIdentity = identity;
firePropertyChange("remoteIdentity", null, this.remoteIdentity);
}
public void setLanguage(Language language) {
this.language = language;
firePropertyChange("language", null, this.language);
@ -659,12 +669,13 @@ public class SubtitleUploadDialog extends JDialog {
checkResult = database.checkSubtitle(mapping.getVideo(), mapping.getSubtitle());
// if (checkResult.exists) {
// mapping.setIdentity(checkResult.identity);
// mapping.setLanguage(Language.getLanguage(checkResult.language)); // trust language hint only if upload not required
// mapping.setState(SubtitleMapping.Status.AlreadyExists);
// return checkResult;
// }
if (checkResult.exists) {
mapping.setRemoteIdentity(checkResult.identity);
mapping.setLanguage(Language.getLanguage(checkResult.language)); // trust language hint only if upload not required
// force upload all subtitles regardless of what TryUploadSubtitles returns (because other programs often submit crap)
// mapping.setState(SubtitleMapping.Status.AlreadyExists);
}
}
if (mapping.getLanguage() == null) {