Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
feat: add stores related to music and digital music
Browse files Browse the repository at this point in the history
  • Loading branch information
adriantombu committed Jan 24, 2024
1 parent bbeb15a commit 044ef5d
Show file tree
Hide file tree
Showing 12 changed files with 425 additions and 276 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
2 changes: 1 addition & 1 deletion manifest-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"short_name": "amazon_alts",
"description": "Find a book or something else in Amazon, et fetch it elswehere!",
"homepage_url": "https://github.com/amazon-alternatives/extension",
"version": "1.12.9",
"version": "1.12.10",
"author": "Adrian Tombu <adrian@otso.fr>",
"icons": {
"48": "assets/icon-48.png",
Expand Down
2 changes: 1 addition & 1 deletion manifest-v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"short_name": "amazon_alts",
"description": "Find a book or something else in Amazon, et fetch it elswehere!",
"homepage_url": "https://github.com/amazon-alternatives/extension",
"version": "1.12.9",
"version": "1.12.10",
"author": "Adrian Tombu <adrian@otso.fr>",
"icons": {
"48": "assets/icon-48.png",
Expand Down
120 changes: 110 additions & 10 deletions src/helpers/__snapshots__/stores.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ exports[`getCountryStores returns American stores 1`] = `
"digital-text",
],
"title": "feedbooks.com",
"url": "http://www.feedbooks.com/search?lang=en&query=%1$s",
"url": "https://www.feedbooks.com/search?lang=en&query=%1$s",
},
{
"categories": [
Expand Down Expand Up @@ -261,6 +261,46 @@ exports[`getCountryStores returns American stores 1`] = `
"title": "bestbuy.com",
"url": "https://www.bestbuy.com/site/searchpage.jsp?st=%1$s&_dyncharset=UTF-8&_dynSessConf=&id=pcat17071&type=page&sc=Global&cp=1&nrp=&sp=&qp=&list=n&af=true&iht=y&usc=All+Categories&ks=960&keys=keys",
},
{
"categories": [
"digital-music",
"music",
],
"title": "qobuz.com",
"url": "https://www.qobuz.com/us-en/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "beatport.com",
"url": "https://www.beatport.com/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "7digital.com",
"url": "https://us.7digital.com/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "hdtracks.com",
"url": "https://www.hdtracks.com/#/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "bleep.com",
"url": "https://bleep.com/search/query?q=%1$s",
},
]
`;

Expand Down Expand Up @@ -474,6 +514,10 @@ exports[`getCountryStores returns French stores 1`] = `
"hi",
"toys",
"office-products",
"digital-music",
"digital-text",
"books",
"music",
],
"title": "fnac.com",
"url": "https://www.fnac.com/SearchResult/ResultList.aspx?Search=%1$s",
Expand Down Expand Up @@ -628,7 +672,7 @@ exports[`getCountryStores returns French stores 1`] = `
"books",
],
"title": "placedeslibraires.fr",
"url": "http://www.placedeslibraires.fr/dlivre.php?gencod=%1$s&rid=",
"url": "https://www.placedeslibraires.fr/dlivre.php?gencod=%1$s&rid=",
},
{
"categories": [
Expand Down Expand Up @@ -737,7 +781,7 @@ exports[`getCountryStores returns French stores 1`] = `
"digital-text",
],
"title": "feedbooks.com",
"url": "http://www.feedbooks.com/search?lang=fr&query=%1$s",
"url": "https://www.feedbooks.com/search?lang=fr&query=%1$s",
},
{
"categories": [
Expand Down Expand Up @@ -945,6 +989,22 @@ exports[`getCountryStores returns French stores 1`] = `
"title": "doctipharma.fr",
"url": "https://www.doctipharma.fr/fr/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "qobuz.com",
"url": "https://www.qobuz.com/fr-fr/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "7digital.com",
"url": "https://fr.7digital.com/search?q=%1$s",
},
]
`;

Expand Down Expand Up @@ -1028,7 +1088,7 @@ exports[`getCountryStores returns German stores 1`] = `
"digital-text",
],
"title": "feedbooks.com",
"url": "http://www.feedbooks.com/search?lang=de&query=%1$s",
"url": "https://www.feedbooks.com/search?lang=de&query=%1$s",
},
{
"categories": [
Expand Down Expand Up @@ -1226,7 +1286,7 @@ exports[`getCountryStores returns Italian stores 1`] = `
"digital-text",
],
"title": "feedbooks.com",
"url": "http://www.feedbooks.com/search?lang=it&query=%1$s",
"url": "https://www.feedbooks.com/search?lang=it&query=%1$s",
},
{
"categories": [
Expand Down Expand Up @@ -1290,7 +1350,7 @@ exports[`getCountryStores returns Spanian stores 1`] = `
"digital-text",
],
"title": "feedbooks.com",
"url": "http://www.feedbooks.com/search?lang=es&query=%1$s",
"url": "https://www.feedbooks.com/search?lang=es&query=%1$s",
},
{
"categories": [
Expand Down Expand Up @@ -1519,6 +1579,10 @@ exports[`getCountryStores with empty host returns default stores 1`] = `
"hi",
"toys",
"office-products",
"digital-music",
"digital-text",
"books",
"music",
],
"title": "fnac.com",
"url": "https://www.fnac.com/SearchResult/ResultList.aspx?Search=%1$s",
Expand Down Expand Up @@ -1673,7 +1737,7 @@ exports[`getCountryStores with empty host returns default stores 1`] = `
"books",
],
"title": "placedeslibraires.fr",
"url": "http://www.placedeslibraires.fr/dlivre.php?gencod=%1$s&rid=",
"url": "https://www.placedeslibraires.fr/dlivre.php?gencod=%1$s&rid=",
},
{
"categories": [
Expand Down Expand Up @@ -1782,7 +1846,7 @@ exports[`getCountryStores with empty host returns default stores 1`] = `
"digital-text",
],
"title": "feedbooks.com",
"url": "http://www.feedbooks.com/search?lang=fr&query=%1$s",
"url": "https://www.feedbooks.com/search?lang=fr&query=%1$s",
},
{
"categories": [
Expand Down Expand Up @@ -1990,6 +2054,22 @@ exports[`getCountryStores with empty host returns default stores 1`] = `
"title": "doctipharma.fr",
"url": "https://www.doctipharma.fr/fr/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "qobuz.com",
"url": "https://www.qobuz.com/fr-fr/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "7digital.com",
"url": "https://fr.7digital.com/search?q=%1$s",
},
]
`;

Expand Down Expand Up @@ -2053,6 +2133,10 @@ exports[`getCountryStores with inexsting tld returns default stores 1`] = `
"hi",
"toys",
"office-products",
"digital-music",
"digital-text",
"books",
"music",
],
"title": "fnac.com",
"url": "https://www.fnac.com/SearchResult/ResultList.aspx?Search=%1$s",
Expand Down Expand Up @@ -2207,7 +2291,7 @@ exports[`getCountryStores with inexsting tld returns default stores 1`] = `
"books",
],
"title": "placedeslibraires.fr",
"url": "http://www.placedeslibraires.fr/dlivre.php?gencod=%1$s&rid=",
"url": "https://www.placedeslibraires.fr/dlivre.php?gencod=%1$s&rid=",
},
{
"categories": [
Expand Down Expand Up @@ -2316,7 +2400,7 @@ exports[`getCountryStores with inexsting tld returns default stores 1`] = `
"digital-text",
],
"title": "feedbooks.com",
"url": "http://www.feedbooks.com/search?lang=fr&query=%1$s",
"url": "https://www.feedbooks.com/search?lang=fr&query=%1$s",
},
{
"categories": [
Expand Down Expand Up @@ -2524,6 +2608,22 @@ exports[`getCountryStores with inexsting tld returns default stores 1`] = `
"title": "doctipharma.fr",
"url": "https://www.doctipharma.fr/fr/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "qobuz.com",
"url": "https://www.qobuz.com/fr-fr/search?q=%1$s",
},
{
"categories": [
"digital-music",
"music",
],
"title": "7digital.com",
"url": "https://fr.7digital.com/search?q=%1$s",
},
]
`;

Expand Down
8 changes: 4 additions & 4 deletions src/helpers/stores.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ test('getCountryStores returns French stores', () => {
const stores = getCountryStores('www.amazon.fr')

expect(stores).toMatchSnapshot()
expect(stores.length).toBe(54)
expect(stores.length).toBe(56)
checkObjectKeys(stores)
})

test('getCountryStores returns American stores', () => {
const stores = getCountryStores('www.amazon.com')

expect(stores).toMatchSnapshot()
expect(stores.length).toBe(18)
expect(stores.length).toBe(23)
checkObjectKeys(stores)
})

Expand Down Expand Up @@ -86,14 +86,14 @@ test('getCountryStores with inexsting tld returns default stores', () => {
const stores = getCountryStores('www.amazon.xyz')

expect(stores).toMatchSnapshot()
expect(stores.length).toBe(54)
expect(stores.length).toBe(56)
checkObjectKeys(stores)
})
test('getCountryStores with empty host returns default stores', () => {
const stores = getCountryStores('')

expect(stores).toMatchSnapshot()
expect(stores.length).toBe(54)
expect(stores.length).toBe(56)
checkObjectKeys(stores)
})

Expand Down
1 change: 1 addition & 0 deletions src/helpers/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export const enum Category {
APPLE_DEVICES = 'apple-devices', // Apple
AMAZON_DEVICES = 'amazon-devices', // Amazon devices
PHOTO = 'photo', // Camera & photo
MUSIC = 'music',
}

interface AltCategory {
Expand Down
27 changes: 26 additions & 1 deletion src/helpers/stores/com.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const stores: Store[] = [
},
{
title: 'feedbooks.com',
url: 'http://www.feedbooks.com/search?lang=en&query=%1$s',
url: 'https://www.feedbooks.com/search?lang=en&query=%1$s',
categories: [Category.DIGITAL_TEXT],
},
{
Expand Down Expand Up @@ -199,4 +199,29 @@ export const stores: Store[] = [
Category.CLOTHING,
],
},
{
title: 'qobuz.com',
url: 'https://www.qobuz.com/us-en/search?q=%1$s',
categories: [Category.DIGITAL_MUSIC, Category.MUSIC],
},
{
title: 'beatport.com',
url: 'https://www.beatport.com/search?q=%1$s',
categories: [Category.DIGITAL_MUSIC, Category.MUSIC],
},
{
title: '7digital.com',
url: 'https://us.7digital.com/search?q=%1$s',
categories: [Category.DIGITAL_MUSIC, Category.MUSIC],
},
{
title: 'hdtracks.com',
url: 'https://www.hdtracks.com/#/search?q=%1$s',
categories: [Category.DIGITAL_MUSIC, Category.MUSIC],
},
{
title: 'bleep.com',
url: 'https://bleep.com/search/query?q=%1$s',
categories: [Category.DIGITAL_MUSIC, Category.MUSIC],
},
]
2 changes: 1 addition & 1 deletion src/helpers/stores/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const stores: Store[] = [
},
{
title: 'feedbooks.com',
url: 'http://www.feedbooks.com/search?lang=de&query=%1$s',
url: 'https://www.feedbooks.com/search?lang=de&query=%1$s',
categories: [Category.DIGITAL_TEXT],
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/stores/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const stores: Store[] = [
...amazonDevicesStores,
{
title: 'feedbooks.com',
url: 'http://www.feedbooks.com/search?lang=es&query=%1$s',
url: 'https://www.feedbooks.com/search?lang=es&query=%1$s',
categories: [Category.DIGITAL_TEXT],
},
{
Expand Down
Loading

0 comments on commit 044ef5d

Please sign in to comment.