Преглед изворни кода

tweak asset logs, fix video upload icon (#1217)

Klaudiusz Dembler пре 3 година
родитељ
комит
aef886a31a

+ 1 - 0
src/providers/assets/assetsManager.tsx

@@ -84,6 +84,7 @@ export const AssetsManager: React.FC = () => {
         } catch (e) {
           // ignore anything else than TimeoutError as it will be handled by assetTestPromise.catch
           if (e instanceof TimeoutError) {
+            AssetLogger.assetTimeout(assetDetails)
             ConsoleLogger.warn('Asset load timed out', assetDetails)
           }
         }

+ 0 - 4
src/providers/assets/helpers.ts

@@ -6,7 +6,6 @@ import {
   VideoFieldsFragment,
 } from '@/api/queries'
 import { createStorageNodeUrl } from '@/utils/asset'
-import { ConsoleLogger } from '@/utils/logs'
 
 import { AssetResolutionData, AssetType } from './types'
 
@@ -38,9 +37,6 @@ export const testAssetDownload = (url: string, type: AssetType): Promise<number>
 
       const performanceEntries = performance.getEntriesByName(url)
       if (performanceEntries.length !== 1) {
-        if (type !== AssetType.MEDIA) {
-          ConsoleLogger.warn('Unexpected number of performance timing entries', { url, performanceEntries })
-        }
         _resolve(0)
         return
       }

+ 14 - 0
src/shared/icons/ControlsVideo.tsx

@@ -0,0 +1,14 @@
+// THIS FILE WAS AUTOGENERATED BY SVGR. DO NOT MODIFY IT MANUALLY.
+import * as React from 'react'
+
+export const SvgControlsVideo = (props: React.SVGProps<SVGSVGElement>) => (
+  <svg width={24} height={24} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
+    <path
+      fillRule="evenodd"
+      clipRule="evenodd"
+      d="M4 12a8 8 0 1016 0 8 8 0 00-16 0zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2z"
+      fill="#F4F6F8"
+    />
+    <path d="M10 9l5 3-5 3V9z" fill="#F4F6F8" />
+  </svg>
+)

+ 5 - 0
src/shared/icons/index.tsx

@@ -1,9 +1,14 @@
 // THIS FILE WAS AUTOGENERATED BY SVGR. DO NOT MODIFY IT MANUALLY.
+export * from './ActionPause'
+export * from './ActionPlay'
+export * from './ActionSoundOff'
+export * from './ActionSoundOn'
 export * from './AlertError'
 export * from './AlertInfo'
 export * from './AlertLoader'
 export * from './AlertSuccess'
 export * from './AlertWarning'
+export * from './ControlsVideo'
 export * from './GlyphAddImage'
 export * from './GlyphAddVideo'
 export * from './GlyphChannel'

+ 0 - 0
src/shared/icons/svgs/action_pause.svg → src/shared/icons/svgs/action-pause.svg


+ 0 - 0
src/shared/icons/svgs/action_play.svg → src/shared/icons/svgs/action-play.svg


+ 0 - 0
src/shared/icons/svgs/action_sound_off.svg → src/shared/icons/svgs/action-sound-off.svg


+ 0 - 0
src/shared/icons/svgs/action_sound_on.svg → src/shared/icons/svgs/action-sound-on.svg


+ 4 - 0
src/shared/icons/svgs/controls-video.svg

@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z" fill="#F4F6F8"/>
+<path d="M10 9L15 12L10 15V9Z" fill="#F4F6F8"/>
+</svg>

+ 8 - 0
src/utils/logs/asset.ts

@@ -65,6 +65,14 @@ class _AssetLogger {
     }
     this.addEvent(event)
   }
+
+  assetTimeout(assetDetails: ResolvedAssetDetails) {
+    const event: AssetEvent = {
+      type: 'asset-download-timeout',
+      ...assetDetails,
+    }
+    this.addEvent(event)
+  }
 }
 
 export const AssetLogger = new _AssetLogger()

+ 2 - 2
src/views/studio/MyUploadsView/UploadStatusGroup/UploadStatusGroup.tsx

@@ -5,7 +5,7 @@ import { useChannel, useVideo } from '@/api/hooks'
 import { useUploadsStore } from '@/providers'
 import { AssetUpload } from '@/providers/uploadsManager/types'
 import { Text } from '@/shared/components'
-import { SvgAlertError, SvgNavChannel, SvgOutlineVideo } from '@/shared/icons'
+import { SvgAlertError, SvgControlsVideo, SvgNavChannel } from '@/shared/icons'
 import { UploadStatusGroupSkeletonLoader } from '@/views/studio/MyUploadsView/UploadStatusGroup/UploadStatusGroupSkeletonLoader'
 
 import {
@@ -103,7 +103,7 @@ export const UploadStatusGroup: React.FC<AssetsGroupBarUploadProps> = ({ uploads
           ) : isChannelType ? (
             <SvgNavChannel />
           ) : (
-            <SvgOutlineVideo />
+            <SvgControlsVideo />
           )}
         </Thumbnail>
         <AssetsInfoContainer>