Skip to content

Commit

Permalink
Fix and simplify Slashdot namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
lwindolf committed Jan 15, 2025
1 parent 8a4295e commit 87306af
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
1 change: 1 addition & 0 deletions css/liferea.css
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ ins {
background:#60A080;
padding-left:0.2rem;
padding-right:0.2rem;
margin-bottom: 0.5rem;
}

.slashSection, .slashDepartment {
Expand Down
38 changes: 15 additions & 23 deletions js/htmlview.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ async function load_item(data, baseURL, direction) {
article = new Readability(shadowDoc, {charThreshold: 100}).parse();
if (article) {
description = article.content;
title = article.title;

// Use rich content from Readability if available and better!
if (article.content.length > item.description.length) {
item.description = article.content;
}
}
}

Expand All @@ -173,28 +177,16 @@ async function load_item(data, baseURL, direction) {
// title duplicate elimination (further below)
title : article?article.title:item.title,

// Use rich content from Readability if available
description : article?article.content:item.description,

author : metadata_get(item, "author"),
creator : metadata_get(item, "creator"),
sharedby : metadata_get(item, "sharedby"),
via : metadata_get(item, "via"),
mediathumb : mediathumb,
mediadesc : mediadesc,
slash : (() => {
let slash = metadata_get(item, "slash");
if (slash) {
let parts = slash.split(',');
return {
section: parts[0] || '',
department: parts[1] || ''
};
}
return null;
})(),
videos : item.enclosures.filter((enclosure) => enclosure.mime?.startsWith('video/')),
audios : item.enclosures.filter((enclosure) => enclosure.mime?.startsWith('audio/'))
author : metadata_get(item, "author"),
creator : metadata_get(item, "creator"),
sharedby : metadata_get(item, "sharedby"),
via : metadata_get(item, "via"),
slashSection : metadata_get(item, "slashSection"),
slashDepartment : metadata_get(item, "slashDepartment"),
mediathumb : mediathumb,
mediadesc : mediadesc,
videos : item.enclosures.filter((enclosure) => enclosure.mime?.startsWith('video/')),
audios : item.enclosures.filter((enclosure) => enclosure.mime?.startsWith('audio/'))
// FIXME: use this too
/*let related = metadata_get(item, "related");
let point = metadata_get(item, "point");
Expand Down

0 comments on commit 87306af

Please sign in to comment.