1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Changed no download limit to be Premium feature only

This commit is contained in:
Uncled1023 2018-02-03 16:52:01 -08:00
parent ce0ded7c55
commit a22f3b3fd9

View File

@ -142,7 +142,7 @@ namespace Teknik.Areas.Upload.Controllers
string iv = string.Empty; string iv = string.Empty;
string contentType = string.Empty; string contentType = string.Empty;
long contentLength = 0; long contentLength = 0;
bool userUploaded = false; bool premiumAccount = false;
DateTime dateUploaded = new DateTime(); DateTime dateUploaded = new DateTime();
using (TeknikEntities db = new TeknikEntities()) using (TeknikEntities db = new TeknikEntities())
@ -161,7 +161,7 @@ namespace Teknik.Areas.Upload.Controllers
contentType = uploads.ContentType; contentType = uploads.ContentType;
contentLength = uploads.ContentLength; contentLength = uploads.ContentLength;
dateUploaded = uploads.DateUploaded; dateUploaded = uploads.DateUploaded;
userUploaded = uploads.User != null; premiumAccount = uploads.User != null && uploads.User.AccountType == AccountType.Premium;
} }
else else
{ {
@ -182,7 +182,7 @@ namespace Teknik.Areas.Upload.Controllers
return View(model); return View(model);
} }
else if (!userUploaded && Config.UploadConfig.MaxDownloadSize < contentLength) else if (!premiumAccount && Config.UploadConfig.MaxDownloadSize < contentLength)
{ {
// We want to force them to the dl page due to them being over the max download size for embedded content // We want to force them to the dl page due to them being over the max download size for embedded content
DownloadViewModel model = new DownloadViewModel(); DownloadViewModel model = new DownloadViewModel();