Skip to content

Instantly share code, notes, and snippets.

> listenbrainz@1.0.0 format /code
> eslint ./static/js/src --ignore-path .gitignore --ext .js,jsx,ts,tsx --fix --quiet
/code/static/js/src/recommendations/RecommendationCard.tsx
21:32 error Unable to resolve path to module '@fortawesome/fontawesome-common-types' import/no-unresolved
✖ 1 problem (1 error, 0 warnings)
npm ERR! code ELIFECYCLE
[2020-11-02 04:08:12,097] DEBUG in daily_activity: Calculating listening_activity_month
[2020-11-02 04:08:12,611] DEBUG in daily_activity: Done!
[2020-11-02 04:08:12,612] DEBUG in request_consumer: Pushing result to RabbitMQ...
[2020-11-02 04:08:15,607] CRITICAL in request_consumer: Error in spark-request-consumer: integer division or modulo by zero
Traceback (most recent call last):
File "/rec/listenbrainz_spark/request_consumer/request_consumer.py", line 148, in run
self.request_channel.start_consuming()
File "/usr/local/lib/python3.6/site-packages/pika/adapters/blocking_connection.py", line 1822, in start_consuming
self.connection.process_data_events(time_limit=None)
File "/usr/local/lib/python3.6/site-packages/pika/adapters/blocking_connection.py", line 758, in process_data_events
<RecommendationControl
iconHover={faAngry}
iconNonHover={faAngryRegular}
title="I never want to hear this again!"
action={() =>
feedback === "hate"
? this.deleteFeedback("Like", faThumbsUpRegular)
: this.submitFeedback("hate", faAngry, "hate")
}
classNameHover="on"
@vansika
vansika / lala.css
Last active October 26, 2020 20:09
<div className="col-xs-1 text-center">
<div className="recommendation-controls">
<>
{this.handleFeedbackOnClick('Like', faThumbsUpRegular)}
<ul
className="dropdown-menu dropdown-menu-right"
aria-labelledby="recommendationControlsDropdown"
>
<RecommendationControl
icon={faAngry}
@vansika
vansika / info.md
Last active October 16, 2020 13:45

The message woula have been long, therefore I have written it here. Please read the whole of it.

**get me top x recommendations:

Screenshot from 2020-10-16 18-15-03

This is not a good option. We already show recs sorted on score, and they aren't good enough. Even if we are making a small change, I don't think we should go from bad -> bad or bad -> worse but bad -> better (at least in theory), therefore this UI feature would not really please users and I don't think they will want to give it a try after they have tried it once.

static/js/src/recommendations/RecommendationCard.tsx(49,31): error TS2345: Argument of type 'Recommendation' is not assignable to parameter of type 'Listen'.
type_checker_1 | Property 'listened_at' is missing in type 'Recommendation' but required in type 'Listen'.
type_checker_1 | static/js/src/recommendations/RecommendationCard.tsx(56,34): error TS2345: Argument of type 'Recommendation' is not assignable to parameter of type 'Listen'.
type_checker_1 | static/js/src/recommendations/Recommendations.tsx(67,44): error TS2345: Argument of type 'Recommendation' is not assignable to parameter of type 'Listen'.
type_checker_1 | static/js/src/recommendations/Recommendations.tsx(273,15): error TS2322: Type 'Recommendation | undefined' is not assignable to type 'Listen | undefined'.
type_checker_1 | Type 'Recommendation' is not assignable to type 'Listen'.
type_checker_1 | static/js/src/recommendations/Recommendations.tsx(275,15): error TS2322: Type 'Recommendation[]' is not assignable
static/js/src/recommendations/RecommendationCard.tsx(49,31): error TS2345: Argument of type 'BaseListenFormat' is not assignable to parameter of type 'Listen'.
type_checker_1 | Property 'listened_at' is missing in type 'BaseListenFormat' but required in type '{ listened_at: number; listened_at_iso?: string | null | undefined; playing_now?: boolean | null | undefined; score?: number | undefined; }'.
type_checker_1 | static/js/src/recommendations/RecommendationCard.tsx(56,34): error TS2345: Argument of type 'BaseListenFormat' is not assignable to parameter of type 'Listen'.
type_checker_1 | Type 'BaseListenFormat' is not assignable to type '{ listened_at: number; listened_at_iso?: string | null | undefined; playing_now?: boolean | null | undefined; score?: number | undefined; }'.
type_checker_1 | static/js/src/recommendations/Recommendations.tsx(67,44): error TS2345: Argument of type 'BaseListenFormat' is not assignable to parameter of type 'Listen'.
type_checker_1 | Type 'BaseLis
@vansika
vansika / lala.tsx
Last active October 14, 2020 14:21
className={`next ${
(typeof listens[listens.length - 1].listened_at !== "undefined" && listens[listens.length - 1].listened_at <= oldestListenTs)
? "disabled"
: ""
}`}
static/js/src/RecentListens.tsx:892:92 - error TS2532: Object is possibly 'undefined'.
892 (typeof listens[listens.length - 1].listened_at !== "undefined" && listens[listens.length - 1].listened_at <= oldestListenTs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#recommendations {
padding: 10px;
> .recommendation-card {
padding: 15px;
margin-bottom: 7px;
max-height: 72px;
playRecommendation = (recommendation: Recommendation): void => {
if (this.brainzPlayer.current) {
this.brainzPlayer.current.playListen(recommendation);
}
};