mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
s3: disable download limits based on file size
This commit is contained in:
committed by
Abdullah Atta
parent
61dd2e1f74
commit
41a185bd9f
@@ -162,15 +162,15 @@ namespace Notesnook.API.Services
|
||||
|
||||
public async Task<string?> GetDownloadObjectUrl(string userId, string name)
|
||||
{
|
||||
var subscriptionService = await WampServers.SubscriptionServer.GetServiceAsync<IUserSubscriptionService>(SubscriptionServerTopics.UserSubscriptionServiceTopic);
|
||||
var subscription = await subscriptionService.GetUserSubscriptionAsync(Clients.Notesnook.Id, userId);
|
||||
// var subscriptionService = await WampServers.SubscriptionServer.GetServiceAsync<IUserSubscriptionService>(SubscriptionServerTopics.UserSubscriptionServiceTopic);
|
||||
// var subscription = await subscriptionService.GetUserSubscriptionAsync(Clients.Notesnook.Id, userId);
|
||||
|
||||
var size = await GetObjectSizeAsync(userId, name);
|
||||
if (StorageHelper.IsFileSizeExceeded(subscription, size))
|
||||
{
|
||||
var fileSizeLimit = StorageHelper.GetFileSizeLimitForPlan(subscription);
|
||||
throw new Exception($"You cannot download files larger than {StorageHelper.FormatBytes(fileSizeLimit)} on this plan.");
|
||||
}
|
||||
// var size = await GetObjectSizeAsync(userId, name);
|
||||
// if (StorageHelper.IsFileSizeExceeded(subscription, size))
|
||||
// {
|
||||
// var fileSizeLimit = StorageHelper.GetFileSizeLimitForPlan(subscription);
|
||||
// throw new Exception($"You cannot download files larger than {StorageHelper.FormatBytes(fileSizeLimit)} on this plan.");
|
||||
// }
|
||||
|
||||
var url = this.GetPresignedURL(userId, name, HttpVerb.GET);
|
||||
if (url == null) return null;
|
||||
|
||||
Reference in New Issue
Block a user