mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-08 15:33:09 -06:00
mediaapi/fileutils: Fix and simplify API doc
This commit is contained in:
parent
703685f0dd
commit
6d000794ec
|
|
@ -189,14 +189,10 @@ func ReadAndHashAndWriteWithLimit(reqReader io.Reader, maxFileSizeBytes types.Fi
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPathFromMediaMetadata validates and constructs the on-disk path to the media
|
// GetPathFromMediaMetadata validates and constructs the on-disk path to the media
|
||||||
// based on its origin and mediaID
|
// based on its Base64Hash
|
||||||
// If a mediaID is too short, which could happen for other homeserver implementations,
|
// If the Base64Hash is long enough, we split it into pieces, creating up to 2 subdirectories
|
||||||
// place it into a short-id subdirectory of the origin directory
|
// for more manageable browsing and use the remainder as the file name.
|
||||||
// If the mediaID is long enough, we split it into pieces, creating up to 2 subdirectories
|
// For example, if Base64Hash is 'qwerty', the path will be 'q/w/erty'.
|
||||||
// for more manageable browsing and use the remainder as the file name. For example, if
|
|
||||||
// mediaID is 'qwerty', we create subdirectories 'q', 'w' within 'q' and place the file
|
|
||||||
// in 'q/w' calling it 'erty'. If the mediaID is shorter than 3 characters, the last
|
|
||||||
// character is the file name and the preceding character, if any, is a subdirectory name.
|
|
||||||
func GetPathFromMediaMetadata(m *types.MediaMetadata, absBasePath types.Path) (string, error) {
|
func GetPathFromMediaMetadata(m *types.MediaMetadata, absBasePath types.Path) (string, error) {
|
||||||
var subPath, fileName string
|
var subPath, fileName string
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue