mirror of
https://github.com/immich-app/immich.git
synced 2024-12-26 10:50:29 +02:00
chore: remove comments
This commit is contained in:
parent
706e3687ff
commit
8cb54dc3fb
@ -109,36 +109,19 @@ async function fileUploader(
|
|||||||
const deviceAssetId = 'web' + '-' + asset.name + '-' + asset.lastModified;
|
const deviceAssetId = 'web' + '-' + asset.name + '-' + asset.lastModified;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Create and add pseudo-unique ID of asset on the device
|
|
||||||
formData.append('deviceAssetId', deviceAssetId);
|
formData.append('deviceAssetId', deviceAssetId);
|
||||||
|
|
||||||
// Get device id - for web -> use WEB
|
|
||||||
formData.append('deviceId', 'WEB');
|
formData.append('deviceId', 'WEB');
|
||||||
|
|
||||||
// Get Asset Created Date
|
|
||||||
formData.append('fileCreatedAt', fileCreatedAt);
|
formData.append('fileCreatedAt', fileCreatedAt);
|
||||||
|
|
||||||
// Get Asset Modified At
|
|
||||||
formData.append('fileModifiedAt', new Date(asset.lastModified).toISOString());
|
formData.append('fileModifiedAt', new Date(asset.lastModified).toISOString());
|
||||||
|
|
||||||
// Set Asset is Favorite to false
|
|
||||||
formData.append('isFavorite', 'false');
|
formData.append('isFavorite', 'false');
|
||||||
|
|
||||||
// Get asset duration
|
|
||||||
formData.append('duration', '0:00:00.000000');
|
formData.append('duration', '0:00:00.000000');
|
||||||
|
|
||||||
// Get asset binary data with a custom MIME type, because browsers will
|
|
||||||
// use application/octet-stream for unsupported MIME types, leading to
|
|
||||||
// failed uploads.
|
|
||||||
formData.append('assetData', new File([asset], asset.name));
|
formData.append('assetData', new File([asset], asset.name));
|
||||||
|
|
||||||
const newUploadAsset: UploadAsset = {
|
uploadAssetsStore.addNewUploadAsset({
|
||||||
id: deviceAssetId,
|
id: deviceAssetId,
|
||||||
file: asset,
|
file: asset,
|
||||||
progress: 0,
|
progress: 0,
|
||||||
};
|
});
|
||||||
|
|
||||||
uploadAssetsStore.addNewUploadAsset(newUploadAsset);
|
|
||||||
|
|
||||||
const response = await axios.post(`/api/asset/upload`, formData, {
|
const response = await axios.post(`/api/asset/upload`, formData, {
|
||||||
params: {
|
params: {
|
||||||
|
Loading…
Reference in New Issue
Block a user