mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-03 14:58:51 -06:00
refactor: name each variant by its md5 prefix
This commit is contained in:
1 parent
f6a509aacc
commit
ed3f61db5d
321 files changed
+97
-23
No files matched your search
@@ -58,12 +58,12 @@ export const byName = (data: Wanted, name: string): Entry[] =>
|
||||
|
||||
// The folder and the name an upload carries, as validate_pr.Placement
|
||||
// gives them: the declared name, beside the held file of that name in
|
||||
// .variants/ with the first 8 characters of the sha1, or the file's own
|
||||
// .variants/ with the first 8 characters of the md5, or the file's own
|
||||
// name when the declarations settle none. bios/ when no folder is known.
|
||||
export const target = (data: Wanted, entry: Entry, file: FileHashes, ownName: string) => {
|
||||
const folder = entry.f === undefined ? 'bios/' : data.folders[entry.f];
|
||||
if (!entry.t) return { folder, name: ownName };
|
||||
if (entry.v) return { folder: `${folder}.variants/`, name: `${entry.t}.${file.sha1.slice(0, 8)}` };
|
||||
if (entry.v) return { folder: `${folder}.variants/`, name: `${entry.t}.${file.md5.slice(0, 8)}` };
|
||||
return { folder, name: entry.t };
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user