Skip to content

Commit

Permalink
chore: tweak import path
Browse files Browse the repository at this point in the history
  • Loading branch information
magicdawn committed Oct 16, 2024
1 parent ad348fd commit 726ca0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/modules/rec-services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { anyFilterEnabled, filterRecItems } from '$components/VideoCard/process/
import { lookinto } from '$components/VideoCard/process/normalize'
import type { RecItemTypeOrSeparator } from '$define'
import { EApiType } from '$define/index.shared'
import { getIService, REC_TABS, type FetcherOptions } from '$modules/rec-services/service-map'
import { uniqBy } from 'lodash'
import { AppRecService } from './app'
import { PcRecService } from './pc'
import { getIService, REC_TABS, type FetcherOptions } from './service-map'

const debug = baseDebug.extend('service')

Expand Down Expand Up @@ -37,7 +37,7 @@ export function concatThenUniq(

const usePcApi = (tab: ETab) => tab === ETab.KeepFollowOnly || tab === ETab.RecommendPc

async function getMinCount(count: number, fetcherOptions: FetcherOptions, filterMultiplier = 5) {
async function fetchMinCount(count: number, fetcherOptions: FetcherOptions, filterMultiplier = 5) {
const { tab, abortSignal, serviceMap } = fetcherOptions

let items: RecItemTypeOrSeparator[] = []
Expand Down Expand Up @@ -126,7 +126,7 @@ async function getMinCount(count: number, fetcherOptions: FetcherOptions, filter
}

export async function refreshForHome(fetcherOptions: FetcherOptions) {
let items = await getMinCount(getColumnCount(undefined, false) * 2, fetcherOptions, 5) // 7 * 2-row
let items = await fetchMinCount(getColumnCount(undefined, false) * 2, fetcherOptions, 5) // 7 * 2-row
if (fetcherOptions.tab === ETab.Watchlater) {
items = items.slice(0, 20)
}
Expand All @@ -143,5 +143,5 @@ export async function refreshForGrid(fetcherOptions: FetcherOptions) {
}
}

return getMinCount(minCount, fetcherOptions, 5)
return fetchMinCount(minCount, fetcherOptions, 5)
}
16 changes: 8 additions & 8 deletions src/modules/rec-services/service-map.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { OnRefreshOptions } from '$components/RecGrid/useRefresh'
import { ETab } from '$components/RecHeader/tab-enum'
import type { IService } from '$modules/rec-services/_base'
import { DynamicFeedRecService, dynamicFeedFilterStore } from '$modules/rec-services/dynamic-feed'
import { FavRecService } from '$modules/rec-services/fav'
import { HotRecService } from '$modules/rec-services/hot'
import { LiveRecService } from '$modules/rec-services/live'
import { PcRecService } from '$modules/rec-services/pc'
import { WatchLaterRecService } from '$modules/rec-services/watchlater'
import type { OnRefreshOptions } from '../../components/RecGrid/useRefresh'
import type { IService } from './_base'
import { AppRecService } from './app'
import { DynamicFeedRecService, dynamicFeedFilterStore } from './dynamic-feed'
import { FavRecService } from './fav'
import { HotRecService } from './hot'
import { LiveRecService } from './live'
import { PcRecService } from './pc'
import { WatchLaterRecService } from './watchlater'

export const REC_TABS = [ETab.KeepFollowOnly, ETab.RecommendPc, ETab.RecommendApp] satisfies ETab[]

Expand Down

0 comments on commit 726ca0b

Please sign in to comment.