pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix styling bugs, fix player not switching source after error, fix allowed state in extension, add ip locked sourced for extension

Co-authored-by: Jip Frijlink <JipFr@users.noreply.github.com>

mrjvs 3704dfba d32ef6ed

+18 -9
+5 -2
src/backend/extension/messaging.ts
··· 37 37 ops: Omit<MessagesMetadata["makeRequest"]["req"], "requestDomain">, 38 38 ): Promise<ExtensionMakeRequestResponse<T> | null> { 39 39 return sendMessage("makeRequest", { 40 - requestDomain: window.location.origin, 40 + requestDomain: window.location.origin, // TODO unsafe 41 41 ...ops, 42 42 }); 43 43 } ··· 54 54 export async function extensionInfo(): Promise< 55 55 MessagesMetadata["hello"]["res"] | null 56 56 > { 57 - return sendMessage( 57 + const message = await sendMessage( 58 58 "hello", 59 59 { 60 60 requestDomain: window.location.origin, 61 61 }, 62 62 300, 63 63 ); 64 + if (!message?.success) return null; 65 + if (!message.allowed) return null; 66 + return message; 64 67 } 65 68 66 69 export function isExtensionActiveCached(): boolean {
+1 -4
src/backend/extension/plasmo.ts
··· 13 13 14 14 export type ExtensionHelloResponse = ExtensionBaseResponse<{ 15 15 version: string; 16 + allowed: boolean; 16 17 }>; 17 18 18 19 export interface ExtensionMakeRequest extends ExtensionBaseRequest { ··· 36 37 targetDomains: string[]; 37 38 requestHeaders?: Record<string, string>; 38 39 responseHeaders?: Record<string, string>; 39 - } 40 - 41 - export interface ExtensionHelloReply { 42 - version: string; 43 40 } 44 41 45 42 export interface MmMetadata {
+1
src/backend/providers/providers.ts
··· 15 15 return makeProviders({ 16 16 fetcher: makeExtensionFetcher(), 17 17 target: targets.BROWSER_EXTENSION, 18 + consistentIpForRequests: true, 18 19 }); 19 20 } 20 21
+1 -1
src/components/player/atoms/settings/SourceSelectingView.tsx
··· 147 147 <Menu.BackLink onClick={() => router.navigate("/")}> 148 148 {t("player.menus.sources.title")} 149 149 </Menu.BackLink> 150 - <Menu.Section> 150 + <Menu.Section className="pb-4"> 151 151 {sources.map((v) => ( 152 152 <SelectableLink 153 153 key={v.id}
+9 -1
src/stores/player/slices/source.ts
··· 116 116 }, 117 117 setSourceId(id) { 118 118 set((s) => { 119 + s.status = playerStatus.PLAYING; 119 120 s.sourceId = id; 120 121 }); 121 122 }, ··· 153 154 s.qualities = qualities as SourceQuality[]; 154 155 s.currentQuality = loadableStream.quality; 155 156 s.captionList = captions; 157 + s.interface.error = undefined; 158 + s.status = playerStatus.PLAYING; 156 159 }); 157 160 const store = get(); 158 161 store.redisplaySource(startAt); ··· 166 169 automaticQuality: qualityPreferences.quality.automaticQuality, 167 170 lastChosenQuality: quality, 168 171 }); 169 - 172 + set((s) => { 173 + s.interface.error = undefined; 174 + s.status = playerStatus.PLAYING; 175 + }); 170 176 store.display?.load({ 171 177 source: loadableStream.stream, 172 178 startAt, ··· 182 188 if (!selectedQuality) return; 183 189 set((s) => { 184 190 s.currentQuality = quality; 191 + s.status = playerStatus.PLAYING; 192 + s.interface.error = undefined; 185 193 }); 186 194 store.display?.load({ 187 195 source: selectedQuality,
+1 -1
src/utils/language.ts
··· 86 86 * @returns pretty format for language, null if it no info can be found for language 87 87 */ 88 88 export function getPrettyLanguageNameFromLocale(locale: string): string | null { 89 - const tag = getTag(populateLanguageCode(locale), true); 89 + const tag = getTag(locale, true); 90 90 const lang = tag?.language?.Description?.[0] ?? null; 91 91 if (!lang) return null; 92 92