Browse Source

Fix for unsupported courses

pull/63/head
Ezerous 6 years ago
parent
commit
35b15e7fb1
  1. 18
      app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java

18
app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java

@ -940,14 +940,16 @@ public class UploadActivity extends BaseActivity {
String retrievedCourse = maybeCourse.replaceAll("-", "").replace("(ΝΠΣ)", "").trim(); String retrievedCourse = maybeCourse.replaceAll("-", "").replace("(ΝΠΣ)", "").trim();
String retrievedSemester = maybeSemester.replaceAll("-", "").trim().substring(0, 1); String retrievedSemester = maybeSemester.replaceAll("-", "").trim().substring(0, 1);
UploadsCourse foundUploadsCourse = UploadsCourse.findCourse(retrievedCourse, uploadsCourses); if(!retrievedCourse.isEmpty()){
UploadsCourse foundUploadsCourse = UploadsCourse.findCourse(retrievedCourse, uploadsCourses);
if(foundUploadsCourse != null){
uploadsCourse = foundUploadsCourse; if(foundUploadsCourse != null){
semester = retrievedSemester; uploadsCourse = foundUploadsCourse;
Timber.d("Selected course: %s, semester: %s", uploadsCourse.getName(), semester); semester = retrievedSemester;
titleDescriptionBuilderButton.setEnabled(true); Timber.d("Selected course: %s, semester: %s", uploadsCourse.getName(), semester);
return; titleDescriptionBuilderButton.setEnabled(true);
return;
}
} }
titleDescriptionBuilderButton.setEnabled(false); titleDescriptionBuilderButton.setEnabled(false);

Loading…
Cancel
Save