Skip to content

Commit

Permalink
Added linting on pull requests. Fixed linter. (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 authored Nov 12, 2023
1 parent 2058f33 commit f7e78f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
on:
push:
branches:
- 'master'
- 'main'
pull_request:
branches:
- 'main'

jobs:
cargolint:
Expand Down
12 changes: 6 additions & 6 deletions src/service/download_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,29 +132,29 @@ impl DownloadService {
});
}

if let None = tag.title() {
if tag.title().is_none() {
tag.set_title(podcast_episode.name);
}

if let None = tag.artist() {
if tag.artist().is_none() {
if let Some(author) = podcast.author{
tag.set_artist(author);
}
}

if let None = tag.album() {
if tag.album().is_none() {
tag.set_album(podcast.name);
}

tag.set_date_recorded(podcast_episode.date_of_recording.parse().unwrap());

if let None = tag.genres(){
if tag.genres().is_none() {
if let Some(keywords) = podcast.keywords {
tag.set_genre(keywords);
}
}

if let None = tag.clone().comments().next() {
if tag.clone().comments().next().is_none() {
tag.add_frame(id3::frame::Comment{
lang: podcast.language.unwrap_or("eng".to_string()),
description: "Comment".to_string(),
Expand All @@ -166,7 +166,7 @@ impl DownloadService {
&podcast_episode
.date_of_recording);

if let None = tag.track() {
if tag.track().is_none() {
if let Ok(track_number) = track_number {
tag.set_track(track_number as u32);
}
Expand Down

0 comments on commit f7e78f6

Please sign in to comment.