Commit graph

115 commits

Author SHA1 Message Date
Stypox
737604faca Fix DatabaseMigrationTest
Complete removal of unneeded index, and remove default value for `remote_playlists.display_index`.
2024-03-29 20:43:55 +01:00
Stypox
564e34b3e7 Merge branch 'dev' into pr8221 2024-03-29 18:08:31 +01:00
Stypox
92c3bedf0d Merge pull request #8242 from dtcxzyw/trim-search-string
Trim search string and remove duplicate records from the database
2024-03-28 18:34:59 +01:00
Stypox
40dd29ddb6 Fix FeedDAOTest 2023-12-29 10:54:31 +01:00
TobiGr
279fc49410 Fix notifiying about old "new" streams
Add tests for `FeedDAO.unlinkStreamsOlderThan(:offsetDateTime) `
Closes #10237
2023-10-14 18:33:21 +02:00
Stypox
f9e1da9c10 Merge pull request #10165 from TeamNewPipe/fix/media-format
Fix downloads of streams with missing MediaFormat
2023-09-19 15:54:12 +02:00
Stypox
4b7d1c4151 Simplify retrieveMediaFormatFromContentTypeHeader
Also check for nullity
2023-09-19 15:33:49 +02:00
AudricV
8922bf76b5 Fix SubscriptionManagerTest tests
The breakage of these tests is related to the channel tabs changes.

The testRememberRecentStreams test method has been removed, as it doesn't seem
to be relevant anymore to managing subscriptions.
2023-09-18 23:22:32 +02:00
TobiGr
cda0e0c57b Apply review 2023-08-16 22:18:53 +02:00
Yingwei Zheng
86f326bb1d Refactor database migration test and string trimming 2023-08-16 22:02:12 +02:00
TobiGr
b7d0198743 Fix database migration and string trimming
Co-authored-by:  Yingwei Zheng <dtcxzyw@qq.com>
2023-08-16 22:02:12 +02:00
TobiGr
8ef6481017 Trim search string and remove duplicate records from the database
Co-authored-by:  Yingwei Zheng <dtcxzyw@qq.com>
2023-08-16 21:26:35 +02:00
TobiGr
c603a5519e Add tests for new methods retrieving MediaFormats
Fix failing tests
2023-08-14 23:06:32 +02:00
TobiGr
2e42298daf Rename StreamSizeWrapper to StreamInfoWrapper 2023-08-14 22:48:39 +02:00
Tobi
47d1997e58 Merge pull request #10235 from TacoTheDank/bumpRoom
Update AndroidX Room library
2023-07-18 22:35:30 +02:00
Stypox
70ab7b268d Improve SubscriptionManager tests
- fix checkstyle errors
- tests do not run in order, so each one has to do its own assertions separately from what others did
- the uid of an entity in the database needn't be the same of the one created in-memory, since the uid gets assigned upon inserting in the database
- some database functions return a `Completable` that doesn't do anything until it is subscribed to or awaited, so I added `.awaitBlocking()` where needed
- the data of an entity in-memory does not get updated automatically when the corresponding entity in the database is changed, so some tests have been removed
- `manager.insertSubscription` only inserts recent streams, so they need to have a date set on them (I also made related items hardcoded and not dependent on what the channel is currently doing)
2023-07-18 08:36:29 +02:00
SydneyDrone
1b2ed3cc0b Create SubscriptionManagerTest.java 2023-07-18 08:36:29 +02:00
TacoTheDank
179ce93d55 Fix MigrationTestHelper deprecation 2023-07-17 21:09:21 -04:00
Jared Fantaye
daa30ec46a Fixed the bug by replacing the thumbnail_url with the thumbnail_stream_id 2023-02-05 20:32:34 +01:00
Stypox
52be821088 Merge pull request #9523 from Jared234/9468_permanently_set_thumbnail
Allow the user to permanently set a thumbnail
2023-01-12 23:27:50 +01:00
Jared Fantaye
be2394e912 Added migration to new database 2022-12-09 22:40:54 +01:00
Isira Seneviratne
3add1e2af3 Use SparseArrayCompat instead of SparseArray in StreamItemAdapter.
Make additional small improvements as well.
2022-11-22 18:31:58 +05:30
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
GGAutomaton
f2059e725a Add tests 2022-04-17 20:20:20 +08:00
GGAutomaton
468a0077ed Migrate database 2022-04-13 19:41:07 +08:00
litetex
b9d5439f29 Fix tests 2022-04-02 15:43:50 +02:00
Mauricio Colli
353f50296d Fix download dialog selector layout and add some tests 2022-04-02 15:25:08 +02:00
TobiGr
c75babedb8 Merge branch 'dev' into feature/notifications 2022-02-19 12:34:44 +01:00
Stypox
77e4714dd0 Improve HistoryRecordManager tests (#7700)
* Improve HistoryRecordManager tests

* Improve shuffle as requested
2022-01-27 14:43:51 +01:00
Stypox
73182bf375 Merge branch 'dev' into pr2335 2022-01-24 10:25:07 +01:00
litetex
bfe2b69af0 Fixed imports 2022-01-21 22:19:52 +01:00
litetex
185b8d77e3 Moved timeout control from the tests to the CI pipeline
How fast a tests is executed on a shared CI pipeline is not predictable as the build might be throttled because other builds are running.
Therefore adding extremely short timeouts inside the tests - where they can't be changed - is a bad idea.
Removed them for now.
2022-01-21 22:15:34 +01:00
XiangRongLin
4c233cf8d6 use constant instead of now 2022-01-20 19:14:47 +01:00
XiangRongLin
c34d4c978b Ensure order of search history entries in tests 2022-01-18 18:36:43 +01:00
XiangRongLin
7cfbd55c3a Replace JUnit asserts with AssertJ in HistoryRecordManagerTest (#7654)
* Replace JUnit asserts with AssertJ in HistoryRecordManagerTest

They provide a wider range of assertions, which allow for more detailed error messages.
Also convert SearchHistoryEntry to kotlin data class for better error messages, since toString() is implemented.

Co-authored-by: Mohammed Anas <triallax@tutanota.com>
2022-01-16 09:10:45 +01:00
Stypox
c70713a925 Merge branch 'dev' into pr2335 2021-12-31 19:20:18 +01:00
Stypox
5da7ab6912 Add HistoryRecordManagerTest 2021-12-12 16:00:16 +01:00
Stypox
fc40db5a95 Add DatabaseMocker to mock NewPipeDatabase 2021-12-12 15:59:04 +01:00
litetex
f85cc793dd Better naming for a test class that does database migrations 2021-11-02 22:43:23 +01:00
TobiGr
1c3cf49835 Remove unused code 2021-10-15 19:57:31 +02:00
TobiGr
ebb49377ee Merge remote-tracking branch 'origin/dev' into notifications-1 2021-10-11 16:37:49 +02:00
Jhon Baron
512427c2d5 Simple Codebase Improvement (#7132)
* feat: it was added a string variable to avoid replication one.

* Update LocalPlaylistManagerTest.kt

* Update LocalPlaylistManagerTest.kt

* Update LocalPlaylistManagerTest.kt

Co-authored-by: Jhon Camilo Baron Berdugo <jbaron@mutualser.org>
2021-09-22 09:17:53 +02:00
Koitharu
e6940d2e45 Fix database test 2021-09-07 13:30:25 +03:00
ktprograms
2ed0843707 Remove migration test, add manual testing reminder to Migrations.java 2021-08-17 08:57:03 +08:00
ktprograms
e1b9f18eef Remove v2 to v3 migration test, add v3 to v4 test 2021-08-16 21:12:54 +08:00
ktprograms
028b7d5c1e Add uploader_url column to StreamEntity 2021-08-13 16:44:50 +08:00
litetex
fdff92d1a4 Fix format of some kotlin files
so that it doesn't annoy people that are building this repo ;)
2021-07-19 20:59:29 +02:00
XiangRongLin
05f9a104f2 Add comment explaining usage Schedulers.trampoline in detail 2021-07-12 18:31:37 +02:00
XiangRongLin
292d2abd62 Add instrumented tests for LocalPlaylistManager.createPlaylist 2021-07-12 18:31:37 +02:00
Stypox
990c3be40c Fix tests 2021-03-12 23:21:54 +01:00