Skip to content
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

InnerTube v2 update #153

Open
wants to merge 114 commits into
base: v3dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
81e9951
Update InnerTube
kuylar May 19, 2024
8a9e1e8
Fix errors and warnings in Utils and Database classes
kuylar May 19, 2024
8ca3449
Add a GetLocals method since the new InnerTube doesn't have it
kuylar May 19, 2024
b14f05b
Fix errors in API endpoints
kuylar May 19, 2024
65bd24c
fix this error i caused
kuylar May 19, 2024
aae42ed
Fix the errors in the contexts
kuylar May 19, 2024
109644c
Implement recommendations endpoint
kuylar May 19, 2024
1869764
Fix empty ctor excuses
kuylar May 22, 2024
7111e39
Reimplement autocomplete
kuylar May 22, 2024
d2d51a2
Fix some API stuff
kuylar May 22, 2024
e9167e6
Fix contexts
kuylar May 22, 2024
84306a1
Fix all controllers except YoutubeController.cs
kuylar May 22, 2024
f4b9d3b
Update YoutubeController.cs
kuylar May 22, 2024
653f392
Fix all views
kuylar May 22, 2024
5d7bc01
Disable authorization
kuylar May 22, 2024
9c96bbb
Implement some renderers for the search view
kuylar May 22, 2024
d3b271e
Move renderer cshtml files to their own directory
kuylar May 22, 2024
d2272d3
Move ContainerRenderer to its own file
kuylar May 22, 2024
dfbabf2
forgot to update these two
kuylar May 22, 2024
493c620
small css fixes
kuylar May 22, 2024
2ca9f4b
Implement the renderers for the watch page
kuylar May 22, 2024
076c3c0
kuylar vs. her own code, round 2
kuylar May 23, 2024
d1ed542
New badges!
kuylar May 23, 2024
1c500d7
Playlist first video IDs
kuylar May 23, 2024
02e935b
Shelf titles
kuylar May 23, 2024
3f9379b
changed like 2 stuff
kuylar May 23, 2024
7373585
Fix playlists
kuylar May 23, 2024
3145214
Round 3
kuylar May 24, 2024
b036e54
Round... 4?
kuylar May 24, 2024
1659550
Channel avatars
kuylar May 24, 2024
44bd6fe
idrk why that exploded
kuylar May 24, 2024
11a2975
Fix the player box aspect ratio
kuylar May 24, 2024
33ad2ff
Update null renderers
kuylar May 24, 2024
3f24de5
posts in search
kuylar May 24, 2024
35be0d1
Implement search chips
kuylar May 24, 2024
75a0e61
hate css
kuylar May 24, 2024
57779fb
Round 5!
kuylar May 27, 2024
ec2b3f7
Fix authentication
kuylar May 27, 2024
b7ad158
Fix namespaces
kuylar May 27, 2024
4780500
Add parserLanguage to where its needed
kuylar May 27, 2024
67dfba7
Fix the like counter
kuylar May 27, 2024
3518330
Fix ToKMB
kuylar May 27, 2024
6096ee9
Implement ResolveUrl where needed
kuylar May 27, 2024
3c4cd6e
Update the channel header
kuylar May 27, 2024
ec20551
Round 6
kuylar May 28, 2024
a1aef03
Implement the featured tab of the channel
kuylar May 28, 2024
5f05764
Implement the shorts tab in channel
kuylar May 28, 2024
4ee7d41
Implement the community tab
kuylar May 28, 2024
e320590
Finish all channel tabs
kuylar May 28, 2024
e42fc0f
fix Utils.cs
kuylar May 28, 2024
f4ee7b6
Update LTPlayer
kuylar May 28, 2024
f7c3af7
Fix the custom CSS
kuylar May 28, 2024
c1ea68f
Fix the player returning the wrong video URLs
kuylar May 28, 2024
f5f5a82
Fix the issues in the player
kuylar May 28, 2024
18c178a
Fix the wrongly called subscribe button
kuylar May 28, 2024
12122f1
Fix search chips
kuylar May 31, 2024
95ab693
fix the ugly filters button
kuylar May 31, 2024
7b9a6ba
fix the player overflowing sideways on mobile
kuylar May 31, 2024
a4d1a44
Clamp player aspect ratios
kuylar May 31, 2024
dc32429
Add a message if only format 18 is available
kuylar May 31, 2024
35508c0
Fix the non-JS player overflowing to the side
kuylar May 31, 2024
500cb4e
Fix nullref in mixes
kuylar May 31, 2024
aef02ee
Make the mobile comment panel scrollable
kuylar May 31, 2024
7fa1371
Make the comments not overscroll to the recommendations
kuylar May 31, 2024
ea20b17
Fix mobile guide z-index
kuylar May 31, 2024
a6f37fd
Add a redirect for /{videoId}
kuylar May 31, 2024
41ce9f8
Fix trailers
kuylar May 31, 2024
889db0e
Round- wait we skipped 7? whatever Round 8
kuylar Jun 1, 2024
32c0a69
Add UI for trailers
kuylar Jun 1, 2024
aa254bb
Fix the HLS manifest url validity checker
kuylar Jun 1, 2024
b5d75db
Fix chips
kuylar Jun 1, 2024
a072601
Fix broken if statements (two of them)
kuylar Jun 1, 2024
16f849b
Fix community posts
kuylar Jun 1, 2024
3f22bac
hey look - a place to get a nullreferenceexception!
kuylar Jun 1, 2024
1ea661b
Add a small thing
kuylar Jun 1, 2024
af39d3e
Remove unused file
kuylar Jun 3, 2024
e79aea5
Add the about tab to channels
kuylar Jun 3, 2024
1c7fbef
Fix the max-lines property
kuylar Jun 3, 2024
ae80b2a
Make the tagline always max out at a single line. Also make it a norm…
kuylar Jun 3, 2024
bd44a2b
Fix community posts in search results
kuylar Jun 3, 2024
10296d3
Fix localization in channel posts
kuylar Jun 3, 2024
64c4c1e
Implement search sidebars
kuylar Jun 3, 2024
8dbdd20
Final round, if no other bugs come up
kuylar Jun 3, 2024
608f9e5
Implement exception renderers
kuylar Jun 3, 2024
5548279
Make the subscription feed API use renderercontainers
kuylar Jun 3, 2024
3f0016d
Add a null check to the playlist panel
kuylar Jun 3, 2024
19ea68d
Fix nullrefs in video caching
kuylar Jun 3, 2024
b6b36d2
Fix nullable ints in the database exploding the playlists
kuylar Jun 3, 2024
6b7eb80
Fix video player obstructing other elements
kuylar Jun 3, 2024
5ad3102
Fix broken html tags in video titles
kuylar Jun 3, 2024
226953f
Add localization to the premiere trailer text
kuylar Jun 4, 2024
6d605d2
Add a &page param to search endpoints
kuylar Jun 4, 2024
4379ce1
Make stats in channel about page wider
kuylar Jun 4, 2024
07b692a
Fix playlists
kuylar Jun 4, 2024
b53daeb
Fix wrong hyperlinks
kuylar Jun 4, 2024
5d5db00
Add editable to PlaylistVideoRendererData
kuylar Jun 6, 2024
e7a5fa6
Fix the avatar in the video player
kuylar Jun 6, 2024
72bafd4
Fix titles turning into 6px line of dots and dashes
kuylar Jun 6, 2024
3d3e6c0
Remove underline from channel tagline
kuylar Jun 6, 2024
d54a1a3
RecognitionShelfRenderer
kuylar Jun 6, 2024
143c27c
Update InnerTube for bug fixes
kuylar Jun 6, 2024
992afbf
but we stay silly
kuylar Jun 6, 2024
0c1c802
Add movieRenderer
kuylar Jun 6, 2024
d8482d9
API: Serialize enums to strings
kuylar Jun 6, 2024
6b462c2
API: Make the UserData folllow the rest of the naming scheme
kuylar Jun 6, 2024
4091a82
That breaks the entire program and wipes the database clean. Use Json…
kuylar Jun 6, 2024
48a9252
API: Add editable field to playlists
kuylar Jun 6, 2024
9c46a45
API: Fix all the nullrefs in the playlist endpoint
kuylar Jun 6, 2024
6e60661
API: Add exact publish date to the subscription feed videos
kuylar Jun 6, 2024
04ab5f2
Make sure the search page doesnt explode when the sidebar throws an e…
kuylar Jun 6, 2024
1f74404
Fix the trailer screen eating all the mouse events
kuylar Jun 6, 2024
b20273b
Make it so videos without valid HLS manifests has UseHls = false
kuylar Jun 6, 2024
b0a736c
Fix the comment headers
kuylar Jun 6, 2024
745fc03
Make the version have the major version in it
kuylar Jun 6, 2024
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
Prev Previous commit
Next Next commit
Fix nullable ints in the database exploding the playlists
  • Loading branch information
kuylar committed Jun 3, 2024
commit b6b36d238b2f24ae7d814c6f277d781237183163
4 changes: 4 additions & 0 deletions LightTube/Database/DatabaseManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using LightTube.Chores;
using LightTube.Database.Models;
using LightTube.Database.Serialization;
using MongoDB.Bson.Serialization;
using MongoDB.Driver;

namespace LightTube.Database;
Expand Down Expand Up @@ -33,6 +35,8 @@ public static void Init(string connstr)
Cache = new CacheManager(ChannelCacheCollection, VideoCacheCollection);
Oauth2 = new Oauth2Manager(Oauth2TokensCollection);
Playlists = new PlaylistManager(PlaylistCollection, VideoCacheCollection);

BsonSerializer.RegisterSerializationProvider(new LightTubeBsonSerializationProvider());

ChoreManager.QueueChore("DatabaseCleanup");
}
Expand Down
23 changes: 23 additions & 0 deletions LightTube/Database/Serialization/BsonNullableIntSerializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Serializers;

namespace LightTube.Database.Serialization;

public class BsonNullableIntSerializer : SerializerBase<int>
{
public override int Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
{
BsonType type = context.Reader.GetCurrentBsonType();
switch (type)
{
case BsonType.Null:
context.Reader.ReadNull();
return 0;
case BsonType.Int32:
return context.Reader.ReadInt32();
default:
return 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using MongoDB.Bson.Serialization;

namespace LightTube.Database.Serialization;

public class LightTubeBsonSerializationProvider : IBsonSerializationProvider
{
public IBsonSerializer? GetSerializer(Type type)
{
return type == typeof(int) ? new BsonNullableIntSerializer() : null;
}
}