Visually makeover
This commit is contained in:
+10
-54
@@ -1,67 +1,23 @@
|
||||
// NOTE: This service worker is for the web/PWA build.
|
||||
// For development we aggressively unregister SWs in `src/player.js`.
|
||||
//
|
||||
// This value is rewritten automatically before each build so deployed clients
|
||||
// refresh to the newest shell and cached assets.
|
||||
const CACHE_NAME = 'radioplayer-pwa-v5-1777474420392';
|
||||
const STATION_SYNC_CACHE_NAME = 'radioplayer-station-sync-v1';
|
||||
// This checked-in file stays stable. The build stamps the token below into
|
||||
// `dist/sw.js` so deployed clients still refresh to the newest shell.
|
||||
const CACHE_NAME = 'radioplayer-pwa-v5-__APP_BUILD_ID__';
|
||||
const STATION_SYNC_CACHE_NAME = 'radioplayer-station-sync-v1-__APP_BUILD_ID__';
|
||||
const MANAGED_CATALOG_CACHE_NAME = 'radioplayer-managed-catalog-v1';
|
||||
const RADIO_BROWSER_API_ENDPOINT = 'https://de1.api.radio-browser.info/json/stations/search';
|
||||
const STATION_SYNC_TAG = 'radio-stations-refresh';
|
||||
const STATION_PERIODIC_SYNC_TAG = 'radio-stations-periodic-refresh';
|
||||
const MANAGED_CATALOG_PERIODIC_SYNC_TAG = 'radioplayer-managed-catalog-refresh';
|
||||
const STATION_SYNC_TAG = '__SW_STATION_SYNC_TAG__';
|
||||
const STATION_PERIODIC_SYNC_TAG = '__SW_STATION_PERIODIC_SYNC_TAG__';
|
||||
const MANAGED_CATALOG_PERIODIC_SYNC_TAG = '__SW_MANAGED_CATALOG_PERIODIC_SYNC_TAG__';
|
||||
const STATION_SYNC_HEADERS = {
|
||||
'content-type': 'application/json; charset=utf-8',
|
||||
};
|
||||
const MANAGED_CATALOG_SOURCE_HEADER = 'x-radioplayer-managed-source';
|
||||
|
||||
const RADIO_COUNTRIES = [
|
||||
{ name: 'Austria', code: 'AT' },
|
||||
{ name: 'Belgium', code: 'BE' },
|
||||
{ name: 'Bulgaria', code: 'BG' },
|
||||
{ name: 'Cyprus', code: 'CY' },
|
||||
{ name: 'Czechia', code: 'CZ' },
|
||||
{ name: 'Denmark', code: 'DK' },
|
||||
{ name: 'Estonia', code: 'EE' },
|
||||
{ name: 'Finland', code: 'FI' },
|
||||
{ name: 'France', code: 'FR' },
|
||||
{ name: 'Germany', code: 'DE' },
|
||||
{ name: 'Greece', code: 'GR' },
|
||||
{ name: 'Russia', code: 'RU' },
|
||||
{ name: 'Hungary', code: 'HU' },
|
||||
{ name: 'Ireland', code: 'IE' },
|
||||
{ name: 'Italy', code: 'IT' },
|
||||
{ name: 'Japan', code: 'JP' },
|
||||
{ name: 'Latvia', code: 'LV' },
|
||||
{ name: 'Lithuania', code: 'LT' },
|
||||
{ name: 'Luxembourg', code: 'LU' },
|
||||
{ name: 'Malta', code: 'MT' },
|
||||
{ name: 'Mexico', code: 'MX' },
|
||||
{ name: 'Netherlands', code: 'NL' },
|
||||
{ name: 'Poland', code: 'PL' },
|
||||
{ name: 'Brazil', code: 'BR' },
|
||||
{ name: 'Portugal', code: 'PT' },
|
||||
{ name: 'Romania', code: 'RO' },
|
||||
{ name: 'Croatia', code: 'HR' },
|
||||
{ name: 'Serbia', code: 'RS' },
|
||||
{ name: 'Montenegro', code: 'ME' },
|
||||
{ name: 'Bosnia & Herzegovina', code: 'BA' },
|
||||
{ name: 'Argentina', code: 'AR' },
|
||||
{ name: 'United Kingdom', code: 'GB' },
|
||||
{ name: 'Slovenia', code: 'SI' },
|
||||
{ name: 'Slovakia', code: 'SK' },
|
||||
{ name: 'Spain', code: 'ES' },
|
||||
{ name: 'USA', code: 'US' },
|
||||
{ name: 'Canada', code: 'CA' },
|
||||
{ name: 'Australia', code: 'AU' },
|
||||
{ name: 'China', code: 'CN' },
|
||||
{ name: 'Sweden', code: 'SE' },
|
||||
{ name: 'Switzerland', code: 'CH' },
|
||||
{ name: 'Turkey', code: 'TR' },
|
||||
{ name: 'Ukraine', code: 'UA' },
|
||||
];
|
||||
const RADIO_COUNTRIES = __RADIO_COUNTRIES_JSON__;
|
||||
const DEFAULT_SYNC_COUNTRY_CODES = RADIO_COUNTRIES.map((country) => country.code);
|
||||
const MANAGED_COUNTRY_CODE = 'SI';
|
||||
const MANAGED_COUNTRY_CODE = '__MANAGED_COUNTRY_CODE__';
|
||||
const MAX_TAGS = 12;
|
||||
const OBVIOUSLY_UNSUPPORTED_CODECS = new Set([
|
||||
'wma',
|
||||
@@ -97,7 +53,7 @@ const DATA_PATHS = new Set([
|
||||
const IMAGE_FALLBACK_PATH = new URL('images/radio-placeholder.svg', self.registration.scope).pathname;
|
||||
const SYNC_CATALOG_URL = new URL('data/radio-stations-sync.json', self.registration.scope).href;
|
||||
const SYNC_CATALOG_PATH = new URL('data/radio-stations-sync.json', self.registration.scope).pathname;
|
||||
const SYNC_META_URL = new URL('data/radio-stations-sync-meta.json', self.registration.scope).href;
|
||||
const SYNC_META_URL = new URL('__SW_STATION_SYNC_META_PATH__', self.registration.scope).href;
|
||||
const SYNC_SETTINGS_URL = new URL('data/radio-stations-sync-settings.json', self.registration.scope).href;
|
||||
const SYNC_COUNTRY_PREFIX_PATH = new URL('data/countries/', self.registration.scope).pathname;
|
||||
const BUNDLED_MANAGED_CATALOG_URL = new URL('stations.json', self.registration.scope).href;
|
||||
|
||||
Reference in New Issue
Block a user