-
-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite PlaybackHelper to use the SDK #3586
Rewrite PlaybackHelper to use the SDK #3586
Conversation
class SdkPlaybackHelper( | ||
private val api: ApiClient, | ||
private val mediaManager: MediaManager, | ||
private val userPreferences: UserPreferences, | ||
private val videoQueueManager: VideoQueueManager, | ||
private val navigationRepository: NavigationRepository, | ||
private val playbackLauncher: PlaybackLauncher, | ||
private val playbackControllerContainer: PlaybackControllerContainer, | ||
) : PlaybackHelper { |
Check warning
Code scanning / detekt
The more parameters a function has the more complex it is. Long parameter lists are often used to control complex algorithms and violate the Single Responsibility Principle. Prefer functions with short parameter lists. Warning
} | ||
} | ||
|
||
private suspend fun getItems( |
Check warning
Code scanning / detekt
One method should have one responsibility. Long methods tend to handle many things at once. Prefer smaller methods to make them easier to understand. Warning
} | ||
} | ||
|
||
private suspend fun getItems( |
Check warning
Code scanning / detekt
Prefer splitting up complex methods into smaller, easier to test methods. Warning
|
||
val items = getItems(item, allowIntros, shuffle) | ||
|
||
if (item.type == BaseItemKind.MUSIC_ALBUM || item.type == BaseItemKind.MUSIC_ARTIST || (item.type == BaseItemKind.PLAYLIST && item.mediaType == MediaType.AUDIO)) { |
Check warning
Code scanning / detekt
Complex conditions should be simplified and extracted into well-named methods if necessary. Warning
} | ||
} | ||
|
||
else -> if (allowIntros && !playbackLauncher.useExternalPlayer(mainItem.type) && userPreferences[UserPreferences.cinemaModeEnabled]) { |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning
|
||
val items = getItems(item, allowIntros, shuffle) | ||
|
||
if (item.type == BaseItemKind.MUSIC_ALBUM || item.type == BaseItemKind.MUSIC_ARTIST || (item.type == BaseItemKind.PLAYLIST && item.mediaType == MediaType.AUDIO)) { |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning
ac6df1b
to
40306c2
Compare
Changes
Issues