Skip to content

Commit

Permalink
feat(shared): add prefix to filename of output .mp4
Browse files Browse the repository at this point in the history
  • Loading branch information
vannizhang committed Apr 3, 2024
1 parent 0117c20 commit d36fb53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const AnimationPanel: FC<Props> = ({ mapView }: Props) => {
width: mapView.width,
height: mapView.height,
}}
authoringAppName="landcover"
/>
</div>
);
Expand Down
11 changes: 10 additions & 1 deletion src/shared/components/AnimationDownloadPanel/DownloadPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ type Props = {
* size of the map view window
*/
mapViewWindowSize: Dimension;
/**
* name of the app/service to be added as prefix to the filename of the output .mp4 file
*/
authoringAppName?: string;
};

/**
Expand All @@ -74,6 +78,7 @@ export const AnimationDownloadPanel: FC<Props> = ({
frameData4DownloadJob,
animationSpeed,
mapViewWindowSize,
authoringAppName,
}) => {
const dispatch = useDispatch();

Expand Down Expand Up @@ -125,7 +130,11 @@ export const AnimationDownloadPanel: FC<Props> = ({
abortController: abortController.current,
});

downloadBlob(fileContent, filename);
const outputFileName = authoringAppName
? `${authoringAppName}-animation-${filename}`
: filename;

downloadBlob(fileContent, outputFileName);

setDownloadJobStatus('finished');
} catch (err) {
Expand Down

0 comments on commit d36fb53

Please sign in to comment.