Giter VIP home page Giter VIP logo

discogs-enhancer's Introduction

Discogs Enhancer

Chrome Web Store Chrome Web Store License GPL 3.0


Project Overview

100% vanilla JS Chrome extension for Discogs.com.

https://www.discogs-enhancer.com

Chrome Webstore Link

https://chrome.google.com/webstore/detail/discogs-enhancer/fljfmblajgejeicncojogelbkhbobejn

A Web Extension for Chrome

Discogs Enhancer adds extra features to both Discogs.com and Chrome. You can block sellers, use a dark theme, see price comparisons, get feedback notifications, convert foreign currencies, search Discogs and other online record shops with any highlighted text, improve tracklist readability, customize lots of Marketplace aspects, and more! Every feature is optional so you can choose the features you want to use.

Features

  • Block Sellers
  • Block Buyer Shortcuts
  • Favorite Sellers
  • Compare suggested prices to listed prices
  • Contextual menu searching
  • Ask for confirmation before removing items from your Collection
  • Quick currency conversion
  • Multiple Dark Themes (WCAG 2.0 AA compliant)
  • Demand Index
  • Scan Artist/Label releases for comments
  • Scan your seller inventory for items priced below the median Marketplace value
  • Tweak Artist/Label Discriminators
  • Everlasting Collection
  • Everlasting Marketplace
  • Buyer/Seller feedback notifications
  • Seller inventory ratings
  • Sort items in the Marketplace by total price (including shipping)
  • Get larger BAOI fields when editing releases
  • Tag Sellers based on reputation
  • Filter Marketplace items by media condition
  • Filter Marketplace items by sleeve condition
  • Filter Marketplace items by shipping country
  • Filter Marketplace items by availability
  • Filter Marketplace items by price
  • Open items in Lists in new tabs
  • Editing notepad for Releases
  • Search Google for releases by clicking on the release title
  • Hide Min, Median, Max columns on the Collection page
  • Marketplace Media/Sleeve condition highlights
  • See the number of ratings/votes a release received in the Marketplace
  • See icons next to seller's names in the Marketplace when you have items of theirs in your cart
  • See release ratings/votes expressed as a percentage
  • Notes character counter
  • See actual dates an item was added to your Collection/Wantlist
  • See the relative date an item was last sold in the Marketplace
  • See the average sale price on the Release page
  • Tag seller's names with an icon in the Marketplace when you have an item of theirs in your cart
  • View a random item from your collection from any page
  • Remove an item from your Wantlist directly from the Marketplace
  • See the total playing time for any release when track times are provided
  • Sort dialog boxes and Marketplace filters alphabetically
  • Easily format comments/reviews using Text Formatting Shortcuts
  • Improve Tracklist readability

Performance

Discogs Enhancer gets a near perfect score with Google's Lighthouse when it comes to impact on user experience. Audit was performed using Exhouse in June of 2019.

Discogs Enhancer flow overview

Overview

Discogs Enhancer flow overview


Installation

  • git clone https://github.com/salcido/discogs-enhancer.git
  • change into the new directory
  • npm install

Running / Development

  • Watch for changes:
    • npm run watch

Testing

  • Run unauthenticated functional tests:

    • npm test
  • Run authenticated functional tests:

    Note: If you want to run authenticated tests you'll need an account to log in with and run them with one of the commands below. When running the authenticated tests, the unauthenticated tests will also be run.

    • env USERNAME=<username> env PASSWORD=<password> npm test
      • This will try to log you in automatically using Discogs authentication.
    • env USEOAUTH=true npm test
      • This will pop up the login page to allow you to manually login via supported OAuth providers; Google, Facebook, or Apple.

Building

  • Export the extension to dist directory:
    • npm run build:production
    • Go to chrome://extensions in a new Chrome tab
    • Click "Developer Mode" in the upper-right corner
    • Click "Load Unpacked" and choose the exported dist folder and you're done!

Functional Tests

Test Checklist (33/37)

AUTHENTICATED

  • Better Collection UI
  • Block Buyers (Requires user w/ sales history)
  • Everlasting Collection
  • Feedback Notifications (Requires user w/ Buyer/Seller feedback)
  • Hide Min/Med/Max columns
  • Larger BAOI Fields
  • Notes Counter
  • Random Item
  • Remove From Wantlist Shortcuts
  • Seller Items In Cart
  • Show Actual Add Date
  • Show Average Prices
  • Suggested Prices
  • Text Format Shortcuts

UNAUTHENTICATED

  • Block Sellers
  • Favorite Sellers
  • Filter Sleeve Condition
  • Inventory Ratings
  • Seller Rep
  • Currency Converter
  • Dark Theme
  • Everlasting Marketplace
  • Filter Media Condition
  • Filter Shipping Country
  • Large YouTube playlists
  • Lists In New Tabs
  • Marketplace Condition Highlights
  • Quick Search
  • Rating Percentage
  • Relative Last Sold Dates
  • Release Durations
  • Release Ratings
  • Release Scanner
  • Sort Buttons
  • Tracklist Readability
  • Tweak Discriminators


🏗 Adding a Feature

In order to add a togglable feature to the extension you'll need to update the files listed below. This guide assumes you've added a new <feature>.js file to js/extension/features/ and that it does not require additional CSS files, configuration pages, or submenus. Features that require their own configuration pages or submenus are more complex and are out of scope for this guide.

1️⃣ background.js

  • Add a new property to the prefs object of background.js. It should be a boolean and have a unique name that easily identifies the feature. Make sure to add the property in the correct alphabetical position.

2️⃣ user-preferences.js

  • Add a conditional check for the new prefs property under the User Preferences comment block. This should check the preference and create a DOM element that contains the necessary script files for the new feature.

Example:

  if ( prefs.featureName ) {

    let featureName = document.createElement('script');

    featureName.type = 'text/javascript';
    featureName.src = chrome.runtime.getURL('js/extension/features/feature-name.js');
    featureName.className = 'de-init';

    elems.push(featureName);
  }

3️⃣ popup.html

  • Modify popup.html with the new preference menu option. Update the markup with a unique id, help-bubble text, and meta keywords. Make sure to add the markup in the correct alphabetical position.

Example:

    <!-- title of the new feature -->
    <div class="toggle-group">
      <p class="label">title of the new feature</p>
      <div class="meta hide">Keywords that represent the feature go here. These are used as metadata when searching.</div>

      <div class="onoffswitch">
        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="toggleNewFeatureName" checked>
        <label class="onoffswitch-label" for="toggleNewFeatureName">
          <span class="onoffswitch-inner"></span>
          <span class="onoffswitch-switch"></span>
        </label>
      </div>

      <div class="help feature-name">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-help-circle" color="#384047"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12" y2="17"></line></svg>
        <div class="help-bubble">
          <div class="help-text">
            A short description of the new feature goes here.
          </div>
          <div class="arrow-right stroke"></div><div class="arrow-right"></div>
        </div>
      </div> <!-- /.help -->
    </div>

4️⃣ utils.js

  • Update the applySave method in utils.js with the same property name used in background.js. Be sure to reference the id set in the popup.html markup and add the property in the correct alphabetical position.

Example:

export function applySave(message, event) {

  let prefs = {
    ...
    featureName: document.getElementById('toggleFeatureName').checked,
    ...
  }
}

5️⃣ popup.js

Make the following changes to popup.js:

  • Update the load eventListener with the new property.
  • Add a new change eventListener under the Event listeners for toggles comment block.
  • Update the chrome.storage.sync.get callback with the new property.

6️⃣ learn.html

Add the feature description to learn.html. Make sure to insert the new markup block in the correct alphabetical order.

Example:

    <div class="feature-block">
      <!-- Feature Name -->
      <h2 id="featureName">Feature Name</h2>

      <p>Supporting text describing how the feature works.</p>
      <!-- supporting image(s) if needed -->
      <img src="../img/learn/feature-image.png" class="max-width" />
    </div>

📦 Build The Extension

Since changes have been made to webpack, the extension will need to be rebuilt by running npm run build. Once the build is finished, load the extension in Chrome by going to chrome://extensions. Make sure Developer Mode is checked, then click 'Load unpacked' and choose the newly exported dist folder. You should now be able to enable the feature from the popup menu.


Author

Buy Me A Coffee

License

This project is licensed under the GPL License - see the LICENSE file for details

discogs-enhancer's People

Contributors

aknorw avatar dependabot-preview[bot] avatar dependabot[bot] avatar ezienecker avatar salcido avatar toastymallows avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

discogs-enhancer's Issues

Feature Request: Wantlist Price Filtering

While Discogs Enhancer already has features to alleviate price gouging, including simply blocking sellers, there nevertheless remain reasons for wanting to apply a price filter to the "Items I Want" page.

A large wantlist easily produces more variation and fluctuation in prices than would be ideal, and although a generic price filter probably sounds slightly hamfisted, quite many webstores and webshops nevertheless have just that very filter.

Therefore, would it be possible to introduce a generic "Price Filter" function to Discogs Enhancer? Although I'm probably a "Maximum" price filter-er myself, I expect people would also want to have "Minimum" as well (both for filtering cheap finds and legitimate archival copies). Therefore the filter would have a min-max range that one could input. I fully admit currencies (and currency conversion) may complicate things further.

I've seen this mentioned in many Discogs forums posts over the years, and only finally realized Discogs Enhancer might be the weapon for this issue!

Possible to change the Inventory link to have the same settings each time?

I sell a fair deal on Discogs, and every time I open my inventory to search for something I usually do so before remembering to set it to For Sale items only instead of just everything, and often I'll forget I have the page set to show 50 results instead of 1000, which I usually don't notice right away (did I mention I'm kinda dumb, haha), is it possible to change the Inventory link so that when I click it in the site it's already set up to just show items for sale? I've got a bookmark for that, but it's in a folder with some other important pages from the site so I generally don't think to use it. Thanks! I love the app btw, super helpful.

Feature request: Whitelist and blacklist continents

Hey @salcido,

I just thought of a nice quality of life improvement. It'd be nice to quickly add to the shipping countries list white or blacklist whole continents. The list would still effectively only contain countries, but you could select a continent and add all its states to your list. It's not particularly a problem with North America, but having to whitelist all countries of other continents can be a bit of a pain.

You could use Wikipedia's list of states by continent as reference.

Feature Request: Show if you already own another edition of a release

Essentially, show an icon or text when viewing a list of items to purchase, as well as on the item details page, to tell you that you already own a copy of the release, but a different version.

For example:
image

image

The benefit of this is for those with larger collections who may sometimes forget which releases they may have already purchased. In my case, I have definitely done the silly thing and purchased an additional copy of something I already owned, but a different version/release...

All tests are skipped?

In this commit, all the tests were changed to add .skip(), making all tests "Pending". Is this as intended? Is there something wrong with the tests?

I enabled one of them locally and it looks like it is passing.

Feature Request: Original Year on Artist Pages

The new Discogs UI shows the latest release (often a reissue) instead of the Original Year of the first release on Artist pages. This newest release then becomes the default 'Year' used when sorting by Year, which makes it difficult to pinpoint the chronological order of original works.

Example:
image

From what I can gather, the 'original release' information is returned in the API Request Response after clicking the 'more versions' buttons under the releases. Here's an example (note: under releaseGroupDetails[0] there is a 'released' parameter which correctly shows 1997.

data : {artist: {discogsId: 59373,…}} artist : {discogsId: 59373,…} discogsId : 59373 releases : {releaseGroupDetails: [{,…}, {,…}, {,…}, {,…}, {,…}], __typename: "ArtistCreditsConnection"} releaseGroupDetails : [{,…}, {,…}, {,…}, {,…}, {,…}] 0 : {,…} release : {discogsId: 2663040, title: "Idle Worship", dataQuality: "NEW_SUBMISSION", visibility: "PUBLIC",…} collectionItems : null country : "US" dataQuality : "NEW_SUBMISSION" discogsId : 2663040 formats : [{name: "CD", quantity: "1", description: ["Album"], text: null, __typename: "Format"}] inWantlist : null labelsNew : [{catalogNumber: "JUMP 010", labelRole: "LABEL", displayName: "Jump Up! Records",…}] masterRelease : {discogsId: 303145, __typename: "MasterRelease"} myListings : {totalCount: 0, __typename: "InventoryItemConnection"} released : "1997" siteUrl : "/release/2663040-The-Eclectics-Idle-Worship" title : "Idle Worship" visibility : "PUBLIC" __typename : "Release" __typename : "ArtistCredit" 1 : {,…} 2 : {,…} 3 : {,…} 4 : {,…} __typename : "ArtistCreditsConnection" __typename : "Artist"

I'm probably barking up the wrong tree here, but I would like this functionality back from Discogs, and judging from their forum posts about this issue, they don't appear to be that fussed about returning it. Perhaps you'd be interested in having a go, or you could point me in the right direction towards a solution (perhaps something that would fit into discogs-enhancer once completed).

Possibility to add custom CSS?

Hello,

I was wondering if there is a way to add custom CSS rules to customize the appearance of Discogs? This could be a separate CSS file in a fixed location which the plugin could read (if you would ;) ).

Kind regards,
Midas

Feature Request: See full size image

Discogs serves images scaled down by default. There's an algorithm/method for translating the discogs provided image back into the originally uploaded one - see this forum thread: https://www.discogs.com/forum/thread/828335

I made a js bookmarklet, that when on the page for a given image, replaces the smaller/lower quality image with the full image - also in that thread.

Would love to see this in discogs-enhancer. Maybe not for all images by default, as that would increase discogs bandwidth and be unecessary, but as an option for when you are looking at zoomed in images

Discogs Exclusives Dark Theme Support

Hi there,

Just wanted to let you know that Discogs recently launched a sub-site called Discogs-Exclusives.
Currently the extensions breaks certain visual aspects of the sub-site.

I am not sure if it's better for you to remove the dark theme support for that site or update this extension to support it.

Feature Request - Revert Master Record listing to old style

The New UI upgrade has made it harder to look through all the versions at once.

Now for large listings, you have to press more, to get each section to load.

simpNGver

The old listing style is still viewable, when you go to edit a release, or just click on versions.
simpNGverList

Maybe there's a way to reimport that data, and then give the usual dropdowns for sorting by year, country, format, etc.

later
-1

Handle Ctrl/Shift + click on "Random item" button

The "Random item" button doesn't act like a regular anchor with an href, and it's a little frustrating to have the current page be forcibly replaced.

You could add to your event listener support for the ctrlKey and shiftKey properties, to open the random item in a new tab, and a new window respectively:

document.querySelector('.de-random-item').addEventListener('click', event => {

Still a pleasure to use your extension, thanks for the continued hard work 👍

Adding more currencies

Hi Matt,

Awesome extension, thanks for making and maintaining it :).

I saw that you're serving the currency JSON from discogs-enhancer.com.
What would it take to add additional currencies?

Bug: "Random item" keeps spinning when you open a new tab

Hey @salcido,

I just saw the new "Random item" button, looks much nicer. There's a small bug though, when I Ctrl + Click it on Chrome, the animation doesn't stop until I mouseleave and mouseenter, and even then it's kind of inconsistent. Stopping the animation on click should fix that.

Thanks again!

Feature Request: Load multiple market pages at the same time

So while scrolling through the marketplace with the "sort by total price" option on, prices are per page and not continuous. This means you'll scroll past low prices to high prices back to high prices. It would be nice if multiple pages could be loaded at once so everything can be in order.

Feature Request: Firefox Port

Firefox uses the same WebExtension standard as Google Chrome with minor differences, so porting and publishing - while a considerable task - wouldn't mean rewriting the extension completely in order to support a new platform.

Adding Firefox support would also help with using Discogs on Android phones, as Firefox supports add-ons on the mobile version.

I currently have to use an installation of Vivaldi just for this add-on so Firefox support would be fantastic! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.