forked from sim0n00ps/OF-DL
Compare commits
3 Commits
333e91d01c
...
c50525bd77
| Author | SHA1 | Date | |
|---|---|---|---|
| c50525bd77 | |||
| 5553bcb4be | |||
| c8e8eaa737 |
@ -246,7 +246,7 @@ public class APIHelper : IAPIHelper
|
||||
}
|
||||
|
||||
|
||||
public async Task<User?> GetUserInfo(string username, string endpoint)
|
||||
public async Task<User?> GetUserInfo(string endpoint)
|
||||
{
|
||||
Log.Debug($"Calling GetUserInfo: {endpoint}");
|
||||
|
||||
@ -275,7 +275,7 @@ public class APIHelper : IAPIHelper
|
||||
user = JsonConvert.DeserializeObject<Entities.User>(body, m_JsonSerializerSettings);
|
||||
|
||||
if (user is not null && !endpoint.EndsWith("/me"))
|
||||
await m_DBHelper.UpdateUserInfo(username, user);
|
||||
await m_DBHelper.UpdateUserInfo(user);
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ namespace OF_DL.Helpers
|
||||
Task<PaidMessageCollection> GetPaidMessages(string endpoint, string folder, string username, int userId, IDownloadConfig config, StatusContext ctx);
|
||||
Task<Dictionary<string, int>> GetPurchasedTabUsers(string endpoint, IDownloadConfig config, Dictionary<string, int> users);
|
||||
Task<List<PurchasedTabCollection>> GetPurchasedTab(string endpoint, string folder, IDownloadConfig config, Dictionary<string, int> users);
|
||||
Task<User> GetUserInfo(string username, string endpoint);
|
||||
Task<User> GetUserInfo(string endpoint);
|
||||
Task<JObject> GetUserInfoById(string endpoint);
|
||||
Dictionary<string, string> GetDynamicHeaders(string path, string queryParam);
|
||||
Task<Dictionary<string, int>> GetActiveSubscriptions(string endpoint, bool includeRestrictedSubscriptions, IDownloadConfig config);
|
||||
|
||||
@ -844,7 +844,7 @@ public class Program
|
||||
//Check if auth is valid
|
||||
var apiHelper = new APIHelper(auth, config);
|
||||
|
||||
Entities.User? validate = await apiHelper.GetUserInfo(string.Empty, $"/users/me");
|
||||
Entities.User? validate = await apiHelper.GetUserInfo($"/users/me");
|
||||
if (validate == null || (validate?.name == null && validate?.username == null))
|
||||
{
|
||||
Log.Error("Auth failed");
|
||||
@ -990,7 +990,7 @@ public class Program
|
||||
try
|
||||
{
|
||||
Log.Information("Updating User Info for for: {Username:l}");
|
||||
User? user_info = await m_ApiHelper.GetUserInfo(username, $"/users/{username}");
|
||||
User? user_info = await m_ApiHelper.GetUserInfo($"/users/{username}");
|
||||
await dbHelper.UpdateUserInfo(username, user_info);
|
||||
|
||||
updateTask.Description = $"{description} - COMPLETE";
|
||||
@ -1222,7 +1222,7 @@ public class Program
|
||||
Log.Debug($"Folder for {user.Key} already created");
|
||||
}
|
||||
|
||||
Entities.User user_info = await m_ApiHelper.GetUserInfo(user.Key, $"/users/{user.Key}");
|
||||
Entities.User user_info = await m_ApiHelper.GetUserInfo($"/users/{user.Key}");
|
||||
|
||||
await dBHelper.CreateDB(path);
|
||||
}
|
||||
@ -1415,7 +1415,7 @@ public class Program
|
||||
|
||||
var downloadContext = new DownloadContext(Auth, Config, GetCreatorFileNameFormatConfig(Config, user.Key), m_ApiHelper, dBHelper);
|
||||
|
||||
User? user_info = await m_ApiHelper.GetUserInfo(user.Key, $"/users/{user.Key}");
|
||||
User? user_info = await m_ApiHelper.GetUserInfo($"/users/{user.Key}");
|
||||
|
||||
if (Config.DownloadAvatarHeaderPhoto && user_info != null)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user