Merge branch 'develop' into feature/inifinite-scroll
This commit is contained in:
commit
3413367480
@ -237,7 +237,7 @@ class SettingsStore {
|
||||
getPortalSettings = async () => {
|
||||
const origSettings = await this.getSettings();
|
||||
|
||||
if (origSettings.plugins.enabled) {
|
||||
if (origSettings?.plugins?.enabled) {
|
||||
initPluginStore();
|
||||
|
||||
this.enablePlugins = origSettings.plugins.enabled;
|
||||
|
@ -219,7 +219,14 @@ internal abstract class SharpBoxDaoBase : ThirdPartyProviderDao<SharpBoxProvider
|
||||
|
||||
protected string MakePath(object entryId)
|
||||
{
|
||||
return $"/{Convert.ToString(entryId, CultureInfo.InvariantCulture).Trim('/')}";
|
||||
var id = Convert.ToString(entryId, CultureInfo.InvariantCulture);
|
||||
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
id = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(id)).Trim('/');
|
||||
}
|
||||
|
||||
return $"/{id}";
|
||||
}
|
||||
|
||||
protected override string MakeId(string path = null)
|
||||
@ -245,7 +252,7 @@ internal abstract class SharpBoxDaoBase : ThirdPartyProviderDao<SharpBoxProvider
|
||||
{
|
||||
path = entry.Id;
|
||||
}
|
||||
var p = string.IsNullOrEmpty(path) || path == "/" ? "" : ("-" + path.Replace('/', '|'));
|
||||
var p = string.IsNullOrEmpty(path) || path == "/" ? "" : ("-" + WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(path)));
|
||||
|
||||
return $"{PathPrefix}{p}";
|
||||
}
|
||||
|
@ -189,7 +189,8 @@ global using Microsoft.AspNetCore.Builder;
|
||||
global using Microsoft.AspNetCore.Http;
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.AspNetCore.Mvc.Filters;
|
||||
global using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
global using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
global using Microsoft.AspNetCore.WebUtilities;
|
||||
global using Microsoft.EntityFrameworkCore;
|
||||
global using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
global using Microsoft.EntityFrameworkCore.Metadata;
|
||||
|
@ -955,6 +955,7 @@ public class EntryManager
|
||||
var folders = entries.Where(r => r.FileEntryType == FileEntryType.Folder).Except(pinnedRooms).Except(rooms);
|
||||
var files = entries.Where(r => r.FileEntryType == FileEntryType.File);
|
||||
pinnedRooms = pinnedRooms.OrderBy(r => r, comparer);
|
||||
rooms = rooms.OrderBy(r => r, comparer);
|
||||
folders = folders.OrderBy(r => r, comparer);
|
||||
files = files.OrderBy(r => r, comparer);
|
||||
|
||||
|
@ -111,7 +111,14 @@ public class FileShareLink
|
||||
}
|
||||
|
||||
var fileId = Parse<T>(doc);
|
||||
var file = await fileDao.GetFileAsync(fileId);
|
||||
|
||||
File<T> file = null;
|
||||
|
||||
if (!EqualityComparer<T>.Default.Equals(fileId, default(T)))
|
||||
{
|
||||
file = await fileDao.GetFileAsync(fileId);
|
||||
}
|
||||
|
||||
if (file == null)
|
||||
{
|
||||
return (FileShare.Restrict, file);
|
||||
|
@ -235,17 +235,20 @@ public class FilesControllerHelper<T> : FilesHelperBase<T>
|
||||
|
||||
public async Task<FileDto<T>> UpdateFileAsync(T fileId, string title, int lastVersion)
|
||||
{
|
||||
File<T> file = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(title))
|
||||
{
|
||||
await _fileStorageService.FileRenameAsync(fileId, title);
|
||||
file = await _fileStorageService.FileRenameAsync(fileId, title);
|
||||
}
|
||||
|
||||
if (lastVersion > 0)
|
||||
{
|
||||
await _fileStorageService.UpdateToVersionAsync(fileId, lastVersion);
|
||||
var result = await _fileStorageService.UpdateToVersionAsync(fileId, lastVersion);
|
||||
file = result.Key;
|
||||
}
|
||||
|
||||
return await GetFileInfoAsync(fileId);
|
||||
return await GetFileInfoAsync(file.Id);
|
||||
}
|
||||
|
||||
public async Task<FileDto<T>> UpdateFileStreamAsync(Stream file, T fileId, string fileExtension, bool encrypted = false, bool forcesave = false)
|
||||
|
Loading…
Reference in New Issue
Block a user