mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	Merge pull request #10732 from Profpatsch/dont-write-media-format
Don't write defaultFormat setting, use default value
This commit is contained in:
		| @@ -643,6 +643,7 @@ public final class ListHelper { | |||||||
|                 context.getString(R.string.best_resolution_key), defaultFormat, videoStreams); |                 context.getString(R.string.best_resolution_key), defaultFormat, videoStreams); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Nullable | ||||||
|     private static MediaFormat getDefaultFormat(@NonNull final Context context, |     private static MediaFormat getDefaultFormat(@NonNull final Context context, | ||||||
|                                                 @StringRes final int defaultFormatKey, |                                                 @StringRes final int defaultFormatKey, | ||||||
|                                                 @StringRes final int defaultFormatValueKey) { |                                                 @StringRes final int defaultFormatValueKey) { | ||||||
| @@ -651,18 +652,14 @@ public final class ListHelper { | |||||||
|  |  | ||||||
|         final String defaultFormat = context.getString(defaultFormatValueKey); |         final String defaultFormat = context.getString(defaultFormatValueKey); | ||||||
|         final String defaultFormatString = preferences.getString( |         final String defaultFormatString = preferences.getString( | ||||||
|                 context.getString(defaultFormatKey), defaultFormat); |                 context.getString(defaultFormatKey), | ||||||
|  |                 defaultFormat | ||||||
|  |         ); | ||||||
|  |  | ||||||
|         MediaFormat defaultMediaFormat = getMediaFormatFromKey(context, defaultFormatString); |         return getMediaFormatFromKey(context, defaultFormatString); | ||||||
|         if (defaultMediaFormat == null) { |  | ||||||
|             preferences.edit().putString(context.getString(defaultFormatKey), defaultFormat) |  | ||||||
|                     .apply(); |  | ||||||
|             defaultMediaFormat = getMediaFormatFromKey(context, defaultFormat); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         return defaultMediaFormat; |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Nullable | ||||||
|     private static MediaFormat getMediaFormatFromKey(@NonNull final Context context, |     private static MediaFormat getMediaFormatFromKey(@NonNull final Context context, | ||||||
|                                                      @NonNull final String formatKey) { |                                                      @NonNull final String formatKey) { | ||||||
|         MediaFormat format = null; |         MediaFormat format = null; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Tobi
					Tobi