jch254 / discogs-market-monitor

Discogs Wantlist Monitor saves manually searching through your wantlist for local listings
MIT License
10 stars 0 forks source link

Use original prices for digest #7

Closed jch254 closed 6 months ago

jch254 commented 1 year ago

Discogs allows the user to their currency settings and converts the data returned from the API based on this

currency

Changing the SHIPS_FROM env var should utilise the original currencies of listings accordingly as opposed to using the the user currency setting.

jch254 commented 1 year ago
  interface Listing {
    status: string;
    original_price: OriginalPrice;
    ships_from: string;
    original_shipping_price: ShippingPrice;
    price: Price;
    allow_offers: boolean;
    uri: string;
    comments: string;
    seller: Seller;
    sleeve_condition: string;
    shipping_price: ShippingPrice;
    release: Release;
    resource_url: string;
    audio: boolean;
    id: number;
    condition: string;
    posted: string;

    // If the authorized user is the listing owner the listing will include 
    // the weight, format_quantity, external_id, and location keys. 
    // If the user is authorized, the listing will contain a in_cart boolean 
    // field indicating whether or not this listing is in their cart.
    in_cart?: boolean;
    weight?: number;
    external_id?: string;
    location?: string;
    format_quantity?: number;
  }

  interface OriginalPrice {
    converted?: OriginalPrice; // appears in marketplace
    curr_abbr: string;
    formatted: string;
    value: number;
    curr_id: number;
  }

  interface ShippingPrice {
    currency: string;
    value: number;
  }

  interface Price {
    currency: string;
    value: number;
  }
jch254 commented 1 year ago

image

image

jch254 commented 6 months ago

Done in https://github.com/jch254/discogs-market-monitor/commit/d3dd6fddc6200b2373cd0fd9a0adeabf1dfd1b8c