Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ import com.lagradost.cloudstream3.ui.player.BasicLink
import com.lagradost.cloudstream3.ui.player.GeneratorPlayer
import com.lagradost.cloudstream3.ui.player.LinkGenerator
import com.lagradost.cloudstream3.ui.result.LinearListLayout
import com.lagradost.cloudstream3.ui.result.ResultViewModel2
import com.lagradost.cloudstream3.ui.result.ResultViewModel
import com.lagradost.cloudstream3.ui.result.START_ACTION_RESUME_LATEST
import com.lagradost.cloudstream3.ui.result.SyncViewModel
import com.lagradost.cloudstream3.ui.search.SearchFragment
Expand Down Expand Up @@ -822,15 +822,15 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
}
}

lateinit var viewModel: ResultViewModel2
lateinit var viewModel: ResultViewModel
lateinit var syncViewModel: SyncViewModel
private var libraryViewModel: LibraryViewModel? = null

/** kinda dirty, however it signals that we should use the watch status as sync or not*/
var isLocalList: Boolean = false
override fun onCreateView(name: String, context: Context, attrs: AttributeSet): View? {

viewModel = ViewModelProvider(this)[ResultViewModel2::class.java]
viewModel = ViewModelProvider(this)[ResultViewModel::class.java]
syncViewModel = ViewModelProvider(this)[SyncViewModel::class.java]

return super.onCreateView(name, context, attrs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AlwaysAskAction : VideoClickAction() {
result: LinkLoadingResult,
index: Int?
) {
// This is handled specially in ResultViewModel2.kt by detecting the AlwaysAskAction
// This is handled specially in ResultViewModel by detecting the AlwaysAskAction
// and showing the player selection dialog instead of executing the action directly
throw NotImplementedError("AlwaysAskAction is handled specially by the calling code")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import com.lagradost.cloudstream3.ui.account.AccountHelper.showAccountEditDialog
import com.lagradost.cloudstream3.ui.account.AccountHelper.showAccountSelectLinear
import com.lagradost.cloudstream3.ui.account.AccountViewModel
import com.lagradost.cloudstream3.ui.result.FOCUS_SELF
import com.lagradost.cloudstream3.ui.result.ResultViewModel2
import com.lagradost.cloudstream3.ui.result.ResultViewModel
import com.lagradost.cloudstream3.ui.result.START_ACTION_RESUME_LATEST
import com.lagradost.cloudstream3.ui.result.getId
import com.lagradost.cloudstream3.ui.result.setLinearListLayout
Expand Down Expand Up @@ -405,7 +405,7 @@ class HomeParentItemAdapterPreview(
{}) {
val newValue = WatchType.entries[it]

ResultViewModel2().updateWatchStatus(
ResultViewModel().updateWatchStatus(
newValue,
fab.context,
item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import com.lagradost.cloudstream3.ui.result.EpisodeAdapter
import com.lagradost.cloudstream3.ui.result.FOCUS_SELF
import com.lagradost.cloudstream3.ui.result.ResultEpisode
import com.lagradost.cloudstream3.ui.result.ResultFragment
import com.lagradost.cloudstream3.ui.result.ResultViewModel2
import com.lagradost.cloudstream3.ui.result.ResultViewModel
import com.lagradost.cloudstream3.ui.result.setLinearListLayout
import com.lagradost.cloudstream3.ui.result.SyncViewModel
import com.lagradost.cloudstream3.ui.result.VideoWatchState
Expand Down Expand Up @@ -2022,7 +2022,7 @@ class GeneratorPlayer : FullScreenPlayer() {

topItem?.let {
playerEpisodeOverlayTitle.setText(
ResultViewModel2.seasonToTxt(
ResultViewModel.seasonToTxt(
topItem.seasonData,
topItem.seasonIndex
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ open class ResultFragmentPhone : FullScreenPlayer() {
}
}

protected lateinit var viewModel: ResultViewModel2
protected lateinit var viewModel: ResultViewModel
protected lateinit var syncModel: SyncViewModel

protected var binding: FragmentResultSwipeBinding? = null
Expand All @@ -120,7 +120,7 @@ open class ResultFragmentPhone : FullScreenPlayer() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
viewModel = ViewModelProvider(this)[ResultViewModel2::class.java]
viewModel = ViewModelProvider(this)[ResultViewModel::class.java]
syncModel = ViewModelProvider(this)[SyncViewModel::class.java]
updateUIEvent += ::updateUI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ResultFragmentTv : BaseFragment<FragmentResultTvBinding>(
BaseFragment.BindingCreator.Inflate(FragmentResultTvBinding::inflate)
) {

private lateinit var viewModel: ResultViewModel2
private lateinit var viewModel: ResultViewModel

override fun onDestroyView() {
updateUIEvent -= ::updateUI
Expand All @@ -82,7 +82,7 @@ class ResultFragmentTv : BaseFragment<FragmentResultTvBinding>(
savedInstanceState: Bundle?
): View? {
viewModel =
ViewModelProvider(this)[ResultViewModel2::class.java]
ViewModelProvider(this)[ResultViewModel::class.java]
viewModel.EPISODE_RANGE_SIZE = 50
updateUIEvent += ::updateUI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ data class ExtractorSubtitleLink(

fun LoadResponse.getId(): Int {
// this fixes an issue with outdated api as getLoadResponseIdFromUrl might be fucked
return (if (this is ResultViewModel2.LoadResponseFromSearch) this.id else null)
return (if (this is ResultViewModel.LoadResponseFromSearch) this.id else null)
?: getLoadResponseIdFromUrl(uniqueUrl, apiName)
}

Expand Down Expand Up @@ -393,7 +393,7 @@ data class ExtractedTrailerData(
var subtitles: List<SubtitleFile> = emptyList(),
)

class ResultViewModel2 : ViewModel() {
class ResultViewModel : ViewModel() {
private var currentResponse: LoadResponse? = null
var EPISODE_RANGE_SIZE: Int = 20
fun clear() {
Expand Down Expand Up @@ -2835,4 +2835,4 @@ class ResultViewModel2 : ViewModel() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,7 @@ fun TvType?.isEpisodeBased(): Boolean {
* Non-episode-based types will return a base folder name, while episode-based types will
* have their files placed in subfolders using a sanitized title name.
*
* For the actual folder path, refer to `ResultViewModel2().getFolder()`, which combines
* For the actual folder path, refer to `ResultViewModel().getFolder()`, which combines
* the folder prefix and, if necessary, the sanitized name to a sub-folder. The folder prefix
* will be used in the root directory of the configured downloads directory.
*
Expand Down