Compare commits
	
		
			2 Commits
		
	
	
		
			9c5274dc06
			...
			6e9c63d3d4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 6e9c63d3d4 | |||
| 
						
						
							
						
						c343735b57
	
				 | 
					
					
						
@ -28,10 +28,7 @@ import com.google.gson.Gson
 | 
				
			|||||||
import com.google.gson.GsonBuilder
 | 
					import com.google.gson.GsonBuilder
 | 
				
			||||||
import com.google.gson.JsonParser
 | 
					import com.google.gson.JsonParser
 | 
				
			||||||
import com.google.gson.reflect.TypeToken
 | 
					import com.google.gson.reflect.TypeToken
 | 
				
			||||||
import kotlinx.coroutines.Dispatchers
 | 
					import kotlinx.coroutines.*
 | 
				
			||||||
import kotlinx.coroutines.GlobalScope
 | 
					 | 
				
			||||||
import kotlinx.coroutines.joinAll
 | 
					 | 
				
			||||||
import kotlinx.coroutines.launch
 | 
					 | 
				
			||||||
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cCourse
 | 
					import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cCourse
 | 
				
			||||||
import org.mosad.seil0.projectlaogai.hsoparser.Course
 | 
					import org.mosad.seil0.projectlaogai.hsoparser.Course
 | 
				
			||||||
import org.mosad.seil0.projectlaogai.hsoparser.MensaMenu
 | 
					import org.mosad.seil0.projectlaogai.hsoparser.MensaMenu
 | 
				
			||||||
@ -111,7 +108,7 @@ class CacheController(cont: Context) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            // make sure the file exists
 | 
					            // make sure the file exists
 | 
				
			||||||
            if (!file.exists())
 | 
					            if (!file.exists())
 | 
				
			||||||
                GlobalScope.launch(Dispatchers.Default) { TCoRAPIController.getCoursesList(context).join() }
 | 
					                runBlocking { TCoRAPIController.getCoursesList(context).join() }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            val fileReader = FileReader(file)
 | 
					            val fileReader = FileReader(file)
 | 
				
			||||||
            val bufferedReader = BufferedReader(fileReader)
 | 
					            val bufferedReader = BufferedReader(fileReader)
 | 
				
			||||||
@ -132,7 +129,7 @@ class CacheController(cont: Context) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            // make sure the file exists
 | 
					            // make sure the file exists
 | 
				
			||||||
            if (!file.exists())
 | 
					            if (!file.exists())
 | 
				
			||||||
                GlobalScope.launch(Dispatchers.Default) { TCoRAPIController.getMensa(context).join() }
 | 
					                runBlocking { TCoRAPIController.getMensa(context).join() }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            val fileReader = FileReader(file)
 | 
					            val fileReader = FileReader(file)
 | 
				
			||||||
            val bufferedReader = BufferedReader(fileReader)
 | 
					            val bufferedReader = BufferedReader(fileReader)
 | 
				
			||||||
@ -150,11 +147,8 @@ class CacheController(cont: Context) {
 | 
				
			|||||||
            val file = File(context.filesDir, "timetable-$courseName-$week.json")
 | 
					            val file = File(context.filesDir, "timetable-$courseName-$week.json")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // make sure the file exists
 | 
					            // make sure the file exists
 | 
				
			||||||
            if (!file.exists()) {
 | 
					            if (!file.exists())
 | 
				
			||||||
                GlobalScope.launch(Dispatchers.Default) {
 | 
					                runBlocking { TCoRAPIController.getTimetable(courseName, week, context).join() }
 | 
				
			||||||
                    TCoRAPIController.getTimetable(courseName, week, context).join()
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            val fileReader = FileReader(file)
 | 
					            val fileReader = FileReader(file)
 | 
				
			||||||
            val bufferedReader = BufferedReader(fileReader)
 | 
					            val bufferedReader = BufferedReader(fileReader)
 | 
				
			||||||
 | 
				
			|||||||
@ -31,10 +31,7 @@ import android.view.ViewGroup
 | 
				
			|||||||
import android.widget.TextView
 | 
					import android.widget.TextView
 | 
				
			||||||
import androidx.fragment.app.Fragment
 | 
					import androidx.fragment.app.Fragment
 | 
				
			||||||
import kotlinx.android.synthetic.main.fragment_home.*
 | 
					import kotlinx.android.synthetic.main.fragment_home.*
 | 
				
			||||||
import kotlinx.coroutines.Dispatchers
 | 
					import kotlinx.coroutines.*
 | 
				
			||||||
import kotlinx.coroutines.GlobalScope
 | 
					 | 
				
			||||||
import kotlinx.coroutines.launch
 | 
					 | 
				
			||||||
import kotlinx.coroutines.withContext
 | 
					 | 
				
			||||||
import org.mosad.seil0.projectlaogai.R
 | 
					import org.mosad.seil0.projectlaogai.R
 | 
				
			||||||
import org.mosad.seil0.projectlaogai.controller.CacheController.Companion.mensaMenu
 | 
					import org.mosad.seil0.projectlaogai.controller.CacheController.Companion.mensaMenu
 | 
				
			||||||
import org.mosad.seil0.projectlaogai.controller.CacheController.Companion.timetables
 | 
					import org.mosad.seil0.projectlaogai.controller.CacheController.Companion.timetables
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user