Commit graph

96 commits

Author SHA1 Message Date
Stypox
39d29cedf0 Add test for ImageStrategy 2023-09-22 10:14:45 +02:00
ThetaDev
e947c88483 fix: audio stream cache key, code fmt 2023-05-01 00:04:04 +02:00
ThetaDev
486488cf78 fix: audio stream format selection 2023-03-19 23:47:33 +01:00
ThetaDev
8749eb9f15 fix: sonarcloud lint 2023-03-19 22:55:37 +01:00
ThetaDev
bb889cf5b7 fix: ListHelper tests 2023-03-19 22:31:31 +01:00
Stypox
d8319716fc Merge pull request #9706 from Jared234/9131_bug_background_player
Fixed a bug that caused the background player to stop working
2023-01-28 21:56:00 +01:00
Jared Fantaye
e119fa40de Replaced the equals method 2023-01-21 14:56:55 +01:00
Jared Fantaye
9459e4951d Fixed tests 2023-01-20 11:12:32 +01:00
Stypox
0470fc2853 Create text subpackage in util 2023-01-15 11:51:07 +01:00
Stypox
1bd45af4fb Fix ListHelperTest failure caused by immutable list being used 2022-07-22 16:09:43 +02:00
Isira Seneviratne
6f77ff6c53 Use List.of(). 2022-07-20 04:39:11 +05:30
litetex
c32fd9a20c Changed the code accordingly
+ Removed some unused code
2022-07-15 19:55:19 +02:00
AudricV
f7d2975ad1 Add support of other delivery methods than progressive HTTP (in the player only)
Detailed changes:

- External players:

  - Add a message instruction about stream selection;
  - Add a message when there is no stream available for external players;
  - Return now HLS, DASH and SmoothStreaming URL contents, in addition to progressive HTTP ones.

- Player:

  - Support DASH, HLS and SmoothStreaming streams for videos, whether they are content URLs or the manifests themselves, in addition to progressive HTTP ones;
  - Use a custom HttpDataSource to play YouTube contents, based of ExoPlayer's default one, which allows better spoofing of official clients (custom user-agent and headers (depending of the client used), use of range and rn (set dynamically by the DataSource) parameters);
  - Fetch YouTube progressive contents as DASH streams, like official clients, support fully playback of livestreams which have ended recently and OTF streams;
  - Use ExoPlayer's default retries count for contents on non-fatal errors (instead of Integer.MAX_VALUE for non-live contents and 5 for live contents).

- Download dialog:

  - Add message about support of progressive HTTP streams only for downloading;
  - Remove several duplicated code and update relevant usages;
  - Support downloading of contents with an unknown media format.

- ListHelper:

  - Catch NumberFormatException when trying to compare two video streams between them.

- Tests:

  - Update ListHelperTest and StreamItemAdapterTest to fix breaking changes in the extractor.

- Other places:

  - Fixes deprecation of changes made in the extractor;
  - Improve some code related to the files changed.

- Issues fixed and/or improved with the changes:

  - Seeking of PeerTube HLS streams (the duration shown was the one from the stream duration and not the one parsed, incomplete because HLS streams are fragmented MP4s with multiple sidx boxes, for which seeking is not supported by ExoPlayer) (the app now uses the HLS manifest returned for each quality, in the master playlist (not fetched and computed by the extractor));
  - Crash when loading PeerTube streams with a separated audio;
  - Lack of some streams on some YouTube videos (OTF streams);
  - Loading times of YouTube streams, after a quality change or a playback start;
  - View count of YouTube ended livestreams interpreted as watching count (this type of streams is not interpreted anymore as livestreams);
  - Watchable time of YouTube ended livestreams;
  - Playback of SoundCloud HLS-only tracks (which cannot be downloaded anymore because the workaround which was used is being removed by SoundCloud, so it has been removed from the extractor).
2022-06-17 22:00:22 +02:00
litetex
b4217315e3 Fixed test compilation 2022-03-26 21:44:16 +01:00
TacoTheDank
15064830d2 Kotlin-ize ReleaseVersionUtil, merge with NewVersionManager 2022-03-03 13:21:50 -05:00
TacoTheDank
112b7dde65 Update ktlint to 0.44.0 2022-02-26 16:08:10 -05:00
litetex
3ae73b417b Extended Tests for ListHelper#getSortedStreamVideosList
* Fixed expected and actual results. They were reversed...
* Added new method ``getSortedStreamVideosListWithPreferVideoOnlyStreamsTest``
2022-02-20 19:40:01 +01:00
TiA4f8R
7786a18517 Prefer video-only streams to video streams
Prefering video-only streams to video streams for our player will allow us to make seamless transitions on 360 and 720p qualities on YouTube.
External players and the downloader are not affected by this change.
2022-02-20 19:38:40 +01:00
TacoTheDank
9ccd358cb8 Update ktlint to 0.43.2 2021-12-04 21:22:29 -05:00
litetex
ba7ceab2a4 Added tests for the `TimestampExtractor` 2021-08-06 22:09:03 +02:00
Stypox
05e2c4898b Add tests for play queue items' equals() 2021-07-21 18:22:17 +02:00
Stypox
460d2aa82f Fix ContentSettingsManager tests 2021-06-08 10:40:45 +02:00
Stypox
84709eb620 Revert all commits related to ContentSettingsFragment
Revert "Annotate methode parameters as NonNull"
This reverts commit af92c3ed4f.

Revert "Commit path immediately when import backup"
This reverts commit c3d9c4bb3f.

Revert "Set ImportExportDataPath only on successful import"
This reverts commit a4bc61a7d0.

Revert "Set ImportExportDataPath only on successful export"
This reverts commit 372d7a7832.

Revert "Invert if condition in ContentSettingsFragment.setImportExportDataPath for better readability"
This reverts commit 2877c43ecb.

Revert "Move ContentSettingsFragment.isValidPath to helpers and add unit test for it."
This reverts commit 15873d53c4.

Revert "Save backup import/export location for feature import/exports"
This reverts commit 01f05e2f46.

Remove FilePathHelperTest file
2021-06-08 10:40:44 +02:00
TobiGr
d0a76d7e60 Use reqireContext(), requireActivity() instead of getters 2021-06-05 16:13:12 +02:00
Zhiheng Xu
fb8896e634 Remove Enclosed.class runner
Does not affect Gradle tests and only benefits IDE workflow
2021-05-24 13:03:52 -04:00
Zhiheng Xu
b8c6043569 Rewrite addToHistory test without using reflection 2021-05-24 12:20:19 -04:00
Zhiheng Xu
b153b5954d Rename mockPlayQueue(…) to makePlayQueue(…) 2021-05-24 12:20:19 -04:00
Zhiheng Xu
0633e93dce Add test for setIndex 2021-05-24 12:20:19 -04:00
Zhiheng Xu
4952483013 Refactor static methods to package private
Stops Android Studio from "recognizing" them as tests
2021-05-24 12:20:19 -04:00
Eric Xu
f9582a3d59 Test getItem(int) 2021-05-24 12:20:19 -04:00
Eric Xu
14e8fe51d0 Refactor making a PlayQueueItem to static method 2021-05-24 12:20:19 -04:00
Eric Xu
9181930625 Test PlayQueue.setIndex(...) 2021-05-24 12:20:19 -04:00
Eric Xu
24b02a2dbd Test PlayQueue equals 2021-05-24 12:20:19 -04:00
XiangRongLin
7dd0c348de Remove unnecessary conversion between file and path 2021-05-21 20:24:11 +02:00
Alireza Tofighi
a880050487 Split up FilePathHelperTest tests in simpler methods 2021-05-21 22:44:38 +04:30
Alireza Tofighi
86d1ce314e Add more tests for FilePathUtils.isValidDirectoryPath for better coverage 2021-05-21 20:28:42 +04:30
Alireza Tofighi
15873d53c4 Move ContentSettingsFragment.isValidPath to helpers and add unit test for it. 2021-05-21 20:21:58 +04:30
krlvm
6069d74311 Fix error in tests 2021-03-27 18:11:39 +03:00
Isira Seneviratne
220bf61e8e Use PrettyTime's new formatUnrounded(OffsetDateTime) method.
Also change the types of the relevant variables from Calendar to OffsetDateTime.
2021-03-18 06:38:12 +05:30
Stypox
bb398189d6 Move all error-related classes into error package 2021-03-07 17:49:28 +01:00
XiangRongLin
22dad3dc9d Respect expires header when checking for new version
It was called to many times and acted similar to a DOS attack.
2021-01-23 09:02:11 +01:00
Stypox
8ad9661aff Merge pull request #5225 from XiangRongLin/extract_settings_import
Extract settings import
2021-01-14 15:18:36 +01:00
Stypox
747d629732 Merge pull request #4947 from Isira-Seneviratne/Convert_ExceptionUtils_to_extensions
Rewrite ExceptionUtils methods as extension functions.
2021-01-14 14:54:37 +01:00
XiangRongLin
88346df803 Add comment about unexpected assertion 2021-01-13 17:25:00 +01:00
Isira Seneviratne
6d4931e77a Add extension functions that accept reified types. 2021-01-11 16:49:46 +05:30
Isira Seneviratne
4d59466977 Rewrite ExceptionUtils methods as extension functions. 2021-01-11 16:49:45 +05:30
XiangRongLin
6a03ac88d3 Make Localization.relativeTime testable
Problem is global state in static variable prettyTime. But for performance reasons on Android that is preferred.
Now allow injecting prettyTime dependency by making init function public.
2021-01-06 14:48:34 +01:00
XiangRongLin
417f791973 cleanup 2021-01-03 20:32:16 +01:00
XiangRongLin
7971a468f6 Fix ensureDbDirectoryExists 2021-01-03 20:32:16 +01:00
XiangRongLin
1e632c3d69 Extract settings file deletion 2021-01-03 20:32:16 +01:00