diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-22 17:04:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-05-22 17:11:31 +0200 |
commit | 83002a823465fe03a8d82833cb2e073a383405a8 (patch) | |
tree | 1b28e2d98c192b1be513cc448be301360f33c8ad /server/lib/activitypub | |
parent | 57c318653e6a8ae9d0c2541a62853fb8dd582d5d (diff) | |
download | PeerTube-83002a823465fe03a8d82833cb2e073a383405a8.tar.gz PeerTube-83002a823465fe03a8d82833cb2e073a383405a8.tar.zst PeerTube-83002a823465fe03a8d82833cb2e073a383405a8.zip |
Update server dependencies
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/videos/shared/object-to-model-attributes.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts index 86699c5b8..8fd0a816c 100644 --- a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts +++ b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { maxBy, minBy } from 'lodash' | 1 | import { maxBy, minBy } from 'lodash' |
2 | import magnetUtil from 'magnet-uri' | 2 | import { decode as magnetUriDecode } from 'magnet-uri' |
3 | import { basename } from 'path' | 3 | import { basename } from 'path' |
4 | import { isAPVideoFileUrlMetadataObject } from '@server/helpers/custom-validators/activitypub/videos' | 4 | import { isAPVideoFileUrlMetadataObject } from '@server/helpers/custom-validators/activitypub/videos' |
5 | import { isVideoFileInfoHashValid } from '@server/helpers/custom-validators/videos' | 5 | import { isVideoFileInfoHashValid } from '@server/helpers/custom-validators/videos' |
@@ -62,7 +62,7 @@ function getFileAttributesFromUrl ( | |||
62 | 62 | ||
63 | if (!magnet) throw new Error('Cannot find associated magnet uri for file ' + fileUrl.href) | 63 | if (!magnet) throw new Error('Cannot find associated magnet uri for file ' + fileUrl.href) |
64 | 64 | ||
65 | const parsed = magnetUtil.decode(magnet.href) | 65 | const parsed = magnetUriDecode(magnet.href) |
66 | if (!parsed || isVideoFileInfoHashValid(parsed.infoHash) === false) { | 66 | if (!parsed || isVideoFileInfoHashValid(parsed.infoHash) === false) { |
67 | throw new Error('Cannot parse magnet URI ' + magnet.href) | 67 | throw new Error('Cannot parse magnet URI ' + magnet.href) |
68 | } | 68 | } |