Skip to content

Add mute strategy configuration [WIP]#1750

Merged
Alkarex merged 1 commit intoFreshRSS:devfrom
aledeg:mute-strategy
Jan 1, 2018
Merged

Add mute strategy configuration [WIP]#1750
Alkarex merged 1 commit intoFreshRSS:devfrom
aledeg:mute-strategy

Conversation

@aledeg
Copy link
Copy Markdown
Member

@aledeg aledeg commented Dec 22, 2017

There is a new configuration setting in the feed configuration which allow to mute it.
There is 4 supported modes:

  • none → nothing is muted, it's the default and previous mode.
  • refresh → feed is not refreshed anymore but is still visible in the interface.
  • display → feed is not displayed anymore but is still refreshed.
  • all → feed is not refreshed nor displayed anymore.

For more info, see #1738


This is far from perfect. There is probably room for improvement and/or fine tuning, but the general idea is here.
Here is a list of things I think are missing:

  • an icon to show the mute strategy on feeds in the configuration page. If you can provide me with an icon, that would be nice. I've changed the color of the icon instead
  • a way to add the new field to the database when upgrading FRSS. I couldn't find where I should put that. I reuse existing fields to add the feature, see Add mute strategy configuration [WIP] #1750 (comment)
    • mysql.
    • sqlite.
    • postgres.
  • check if the api is filtered
  • check if the RSS feed is filtered
  • some thorough testing.

@aledeg
Copy link
Copy Markdown
Member Author

aledeg commented Dec 22, 2017

@Jucgshu if you could have a look at that. I think this will solve you're problem.

@aledeg aledeg force-pushed the mute-strategy branch 2 times, most recently from ae6163d to a947cd2 Compare December 22, 2017 19:28
@Jucgshu
Copy link
Copy Markdown
Contributor

Jucgshu commented Dec 22, 2017

Hi @aledeg

Just switched to your branch to test it. Looks like I have an error when trying to move the feeds to 'all' muted: SQL error updateFeed: syntax error

Tried with https://nextcloud.com/blogfeed/ and https://www.myopenrouter.com/rss

@aledeg
Copy link
Copy Markdown
Member Author

aledeg commented Dec 22, 2017

@Jucgshu You need to add a field in the feed table to hold the configuration. Sorry I forgot to mention that. Do you need the syntax ?

@Jucgshu
Copy link
Copy Markdown
Contributor

Jucgshu commented Dec 22, 2017

Yes please @aledeg ;-)

@aledeg
Copy link
Copy Markdown
Member Author

aledeg commented Dec 22, 2017

alter table feed add column muteStrategy int(11) not null default 0;

Don't forget to add your prefix before feed.

@Alkarex Alkarex added this to the 1.10.0 milestone Dec 22, 2017
@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented Dec 22, 2017

@aledeg We need to auto-add this new field. Here is an example for the entry table:

protected function addColumn($name) {

@Alkarex Alkarex added the Work in progress 🚧 Wait before merging label Dec 22, 2017
@aledeg
Copy link
Copy Markdown
Member Author

aledeg commented Dec 22, 2017

@Alkarex I've added the auto-update of the column

}
public function feeds() {
if ($this->feeds === null) {
if (null === $this->feeds) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any advantage of writing the comparison in reverse?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On this one not really, but when you're working with variables, you're sure you are not assigning a variable by mistake. For instance:

// This is always true
if ($var = 'hello')...

// This fails
if ('hello' = $var)...

I found that it's a good habit to have tests in reverse. My 2¢

return false;
}

public function autoUpdateDb($errorInfo) {
Copy link
Copy Markdown
Member

@Alkarex Alkarex Dec 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add the code for SQLite and PostgreSQL too, in FeedDAOSQLite.php and FeedDAOPGSQL.php.
Examples for the entry table:

Since the code is similar for all tables, we could consider factorising it somehow (can wait to another PR later).

As it is the first new field after we have introduced PostgreSQL, I do not yet have the full example for it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

'api' => array(
'documentation' => 'Copy the following URL to use it within an external tool.',// TODO
'title' => 'API',// TODO
'documentation' => 'Copy the following URL to use it within an external tool.', // TODO
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, please avoid changes in parts of the code not related to the PR. (It was probably automatic, but you might have a way of avoiding it, don't you?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@aledeg aledeg force-pushed the mute-strategy branch 11 times, most recently from 0310663 to d3b4ef0 Compare December 23, 2017 16:33
@aledeg
Copy link
Copy Markdown
Member Author

aledeg commented Dec 23, 2017

@Jucgshu @Alkarex If you could test more thoroughly what I've done, that would be great :)

@aledeg aledeg force-pushed the mute-strategy branch 2 times, most recently from e972852 to b6ece4d Compare December 25, 2017 21:07
@aledeg
Copy link
Copy Markdown
Member Author

aledeg commented Dec 25, 2017

@Alkarex I've changed the greader file. I've added my filter and it works fine. I think the modified query doesn't work with SQLite because of the prefix. Why don't we use directly the DAO there on the first place ?

@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented Jan 1, 2018

I have just tested (execution time and EXPLAIN) the main modified SQL requests on my little Atom server using MySQL 5.7.20-0ubuntu, with 275k articles, and it looks fine.

@Alkarex Alkarex removed the Work in progress 🚧 Wait before merging label Jan 1, 2018
@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented Jan 1, 2018

I think we can merge soon, to get some more testing in the /dev branch.

My final comment is about the visualisation of the muted feeds (currently a greyed favicon): it does not do anything on favicons already in back&white, and makes some favicons unrecognisable (the ones which happen to use multiple colours giving the same grey). There are multiple approaches, but I am thinking of adding a Unicode character like pause ⏸ or stop
image

$stm = $pdo->prepare('SELECT f.id, f.name, f.url, f.website, c.id as c_id, c.name as c_name FROM `%_feed` f
INNER JOIN `%_category` c ON c.id = f.category');
$stm->execute();
INNER JOIN `%_category` c ON c.id = f.category AND f.priority >= :priority_normal');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups. Typo here. It is a WHERE, not an AND.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's on purpose. The inner join is done on the category and the priority

@aledeg
Copy link
Copy Markdown
Member Author

aledeg commented Jan 1, 2018

@Alkarex I've changed the rendition of the feed when muted

@Alkarex
Copy link
Copy Markdown
Member

Alkarex commented Jan 1, 2018

My API is not working anymore (empty). I have not checked why yet. I will come back later.

@aledeg
Copy link
Copy Markdown
Member Author

aledeg commented Jan 1, 2018

@Alkarex I've found why the API wasn't working anymore. I've fixed it.

vertical-align: middle;
}
.feed.mute::after {
content: '🔇';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea with the mute sign. The CSS rule does not seem to work so well:

image

Maybe something like:

.feed.mute > .item-title::after {
	content: ' 🔇';
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, but it doesn't work in the subscription list :(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work either if there is an ellipsis

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've put it before instead of after. It works everywhere.

I've took into account everything that was said by @Alkarex to extend what we already
have instead of creating something new.
@Alkarex Alkarex merged commit 8c2113f into FreshRSS:dev Jan 1, 2018
@aledeg aledeg deleted the mute-strategy branch January 1, 2018 19:46
Alkarex added a commit that referenced this pull request Jan 1, 2018
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Jan 2, 2018
FreshRSS#907

CURLOPT_FOLLOWLOCATION open_basedir bug (FreshRSS#1657)

CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set
FreshRSS#1655 (comment)
https://stackoverflow.com/questions/6918623/curlopt-followlocation-cannot-be-activated
Manual merge dev

Add an entry in the subscription tool page

I reworked @Alkarex idea proposed in FreshRSS#1292. I though it was a good idea to merge everything in the same location.

Improve translation tools

I was not happy with the previous version. I refactored everything to make it reusable.
It allows me do do more verifications and to build a tool to handle the files themselves.

Merge pull request FreshRSS#1660 from aledeg/api-subscription-tool

Add an entry in the subscription tool page
Merge pull request FreshRSS#1658 from aledeg/improve-i18n-tools

Improve translation tools
Changelog 1247

FreshRSS#1660
FreshRSS#1292
FreshRSS#1247

Merge branch 'FreshRSS/dev' into github-update

[i18] nl/sub: add a few translations
Merge pull request FreshRSS#1661 from FreshRSS/Frenzie-patch-1

[i18] nl/sub: add a few translations
Reworded changelog 1247

FreshRSS#1660
FreshRSS#1292
FreshRSS#1247

Merge branch 'dev' of https://github.com/FreshRSS/FreshRSS into FreshRSS/dev

CLI optimize database (FreshRSS#1663)

CLI optimize database FreshRSS#1583
And VACUUM in SQLite FreshRSS#918
Add VACUUM for PostgreSQL (Not tested yet)
A bit of Apache documentation (FreshRSS#1670)

FreshRSS#1666
FreshRSS#1669
FreshRSS#908
Merge branch 'FreshRSS/dev' into github-update

Delete unneeded update files

Move update scripts

Merge branch 'staging-branch' into github-update

Fix Travis syntax

Fix typo in nl i18n (FreshRSS#1675)


improve zh-cn i18n (FreshRSS#1678)


Move translation tools into the cli folder (FreshRSS#1673)

Translation tools must be used on cli. It is better to have them in the cli folder.
Add a Mastodon share (FreshRSS#1674)

See FreshRSS#1521 
Minor language

Small fix Mastodon share

$a['method'] can be undefined.
FreshRSS#1674
FreshRSS#1521

Changelog Mastodon

Merge pull request FreshRSS#1682 from Alkarex/fix_mastodon_share

Small fix Mastodon share
Merge branch 'FreshRSS/dev' into github-update

More update

Split post-update in disctinct file

Post-update will thus contain code from the new version

Better case for git

Fix link encoding in API (FreshRSS#1686)

FreshRSS#1683
Alkarex/EasyRSS#35
A bit of documentation for the API (FreshRSS#1689)

FreshRSS#1687
FreshRSS#443 (comment)

Merge branch 'FreshRSS/dev' into github-update

[docs] Configuration: some stylistic improvements (FreshRSS#1693)

The main purpose is to fix the `imapcted` typo that was exposed by FreshRSS#1259 (comment)
[FIX] FreshRSS#1690 - Also check pdo_pgsql extension in check_install()

[ADD] 'blankoworld' as contributor in CREDITS

Changelog 1690

FreshRSS#1690
FreshRSS#1691
FreshRSS#1692

I18n - DE (FreshRSS#1698)

* added missing german translations
Call idn_to_ascii with INTL_IDNA_VARIANT_UTS46

Under PHP 7.2, calling `idn_to_ascii($idn)` results in a deprecation warning: 'INTL_IDNA_VARIANT_2003 is deprecated'
See https://secure.php.net/manual/en/function.idn-to-ascii.php 

Therefore, if possible, `idn_to_ascii($idn, 0, INTL_IDNA_VARIANT_UTS46)` should be used instead. `INTL_IDNA_VARIANT_UTS46` was introduced in PHP 5.4, so on versions before that, `idn_to_ascii($idn)` must still be used.

Fixed FreshRSS#1699
A bit more for git updates

Documentation updates (FreshRSS#1697)

* added documentation about updating FreshRSS
moved Installation to admin directory
linked some already existing documentation files
Update panel shows latest version message as success (FreshRSS#1701)

show latest version message as success, FIXES FreshRSS#1586
Merge branch 'FreshRSS/master' into FreshRSS/dev

Remove forgotten punycode line

Credits Craig Andrews

Merge pull request FreshRSS#1700 from candrews/patch-1

Call idn_to_ascii with INTL_IDNA_VARIANT_UTS46
Changelog  1586 1698 1699

FreshRSS#1586
FreshRSS#1701
FreshRSS#1698
FreshRSS#1699
FreshRSS#1700

Merge branch 'dev' of https://github.com/FreshRSS/FreshRSS into FreshRSS/dev

Merge branch 'FreshRSS/dev' into github-update

Add more glyphs for opensans font (FreshRSS#1032)

* Add more glyphs for opensans font

* Update .htaccess to support woff2 file format

* Fixed browser support for new font face

* Fixed Origine theme css and .htaccess

* Deleted unneeded fonts

* Added stylefiles for OpenSans font

* Fixed all themes with new font css

* Avoid additional CSS file

* htaccess cache control public

* Font casing bug

* Remove TTF font

Too big, low need https://caniuse.com/#search=woff

* Changelog 1032

FreshRSS#1032
FreshRSS#1028

Extension function to override entry hash (FreshRSS#1707)

Extension function to override entry hash
FreshRSS#1706


Merge branch 'FreshRSS/dev' into github-update

Show existing extensions in admin panel (FreshRSS#1708)

* first draft

* display installed extension state

* fixed whitespace vs tabs

* added translation in all languages

* added error checks and log messages

* fixed tabs vs whitespace

* another try in fixing whitespaces

* another try in fixing whitespaces

* improved extension list translations

* using JSON from official extension repo

* improved version compare

* updated translations

* French translation

make sure that we do not exceed a certain file size for the users log file

renamed method

incorporated code review feedback

added new extension hook
using hook for reading modes in navigation

refactored ReadingModes to Model

Log rotation, use Minz_Log, new log constants

ADMIN_LOG, API_LOG, PSHB_LOG

Check requirement in CLI script (FreshRSS#1711)

* check requirements in actualize_script before executing, fixes FreshRSS#1710

* removed empty whiteline

* testing all requirements

* incorporated code review feedback

* removed code that is already executed in _cli.php

* added newline at eof

* fixed include problems

* fixed include problems

Merge branch 'dev' into logfilesize
Merge branch 'dev' into logfilesize
Changelog 1708 1711

FreshRSS#1708
FreshRSS#1711

Merge pull request FreshRSS#1712 from kevinpapst/logfilesize

Prevent logfile from growing unlimited
Changelog 1712

FreshRSS#1712
FreshRSS#1562

Use __DIR__ for relative include and require

For uniformity, and to avoid having PHP searching in include_path.
http://php.net/manual/function.include.php
FreshRSS#1715
FreshRSS#1711 (comment)

Merge pull request FreshRSS#1717 from Alkarex/dir_in_require

Use __DIR__ for relative include and require
fixed bug in catch block
added types to docblocks

Merge pull request FreshRSS#1724 from kevinpapst/exception-bug

ExtensionManager fixes
[doc] Extensions: translate various sections from French

See FreshRSS#1697 (comment)

* lowercase dir as pointed out by @kevinpapst in FreshRSS#1704 (comment)

* Add French translation with improvements suggested by @aledeg

Merge branch 'dev' into hebrew-i18n
Fix whitespace

Add message after log rotation

FreshRSS#1712
FreshRSS#1562

Minz Dispatcher Controllers path

FreshRSS#1704

Customisable constants.local.php (FreshRSS#1725)

FreshRSS#1562
FreshRSS#1607
FreshRSS#1656
FreshRSS#1705
FreshRSS#1712
Merge pull request FreshRSS#1726 from Alkarex/message_log_rotation

Add message after log rotation
i18n hebrew more

18n Hebrew more 2

Changelog 1716 1724 1725

https://github.com/FreshRSS/FreshRSS/pull/1716
FreshRSS#1724
FreshRSS#1725

Merge branch 'FreshRSS/dev' into Minz_Dispatcher_paths

Changelog 1729

Merge pull request #1716 from FreshRSS/hebrew-i18n

Add hebrew translation
Changelog 1716

https://github.com/FreshRSS/FreshRSS/pull/1716

Merge pull request FreshRSS#1729 from Alkarex/Minz_Dispatcher_paths

Minz Dispatcher Controllers path
added .editorconfig with basic settings

Minz Controllers directory uppercase

FreshRSS#1729

Merge pull request FreshRSS#1704 from Frenzie/doc-translate-extensions

[doc] Extensions: translate various sections from French
Merge pull request FreshRSS#1732 from kevinpapst/editorconfig

Added .editorconfig
Changelog 1697, 1704, 1732

FreshRSS#1697
FreshRSS#1704
FreshRSS#1732

Merge branch 'dev' of https://github.com/FreshRSS/FreshRSS into FreshRSS/dev

fixed bug when adding a category and feed at the same time (FreshRSS#1731)

fixed bug when adding a category and feed at the same time

Changelog 1731

FreshRSS#1731

Fix favicon for open_basedir (FreshRSS#1733)

Remove open_basedir warning for CURLOPT_FOLLOWLOCATION with PHP 5.6.0- https://bugs.php.net/bug.php?id=65646
Remove warning for CURLOPT_FOLLOWLOCATION with open_basedir (FreshRSS#1734)

For PHP 5.6.0- http://www.php.net/ChangeLog-5.php#5.6.0
https://bugs.php.net/bug.php?id=65646
FreshRSS#1733
FreshRSS#1657
FreshRSS#1655
Prepare release of FreshRSS 1.9.0

Merge pull request FreshRSS#1720 from FreshRSS/dev

FreshRSS 1.9.0
Update FreshRSS version to 1.9.0

Merge branch 'FreshRSS/dev' into FreshRSS/master

[docs] Extensions: fix typo (FreshRSS#1735)


Merge branch 'FreshRSS/dev' into FreshRSS/master

New development version 1.9.1-dev

PHP 7.2: Fix a warning when retrieving the list of entries (FreshRSS#1739)

When retrieving the list of entries when the context was 'all' or 'starred', there was the following warning:

> Warning: count(): Parameter must be an array or an object that implements Countable in /home/alexis/FreshRSS/app/Controllers/indexController.php on line 206

I fixed that by changing how the array is tested.
Fixes link to the "update guidelines" (FreshRSS#1740)


Fixes link to the "update guidelines" (FreshRSS#1740)


Minor changes (FreshRSS#1747)


Tiny additions to .editorconfig (FreshRSS#1744)


Improving README in English and French (FreshRSS#1746)


Merge branch 'FreshRSS/master' into FreshRSS/dev

Adding new items to force-https.default.txt (FreshRSS#1745)


credits  RyDroid

FreshRSS#1747
FreshRSS#1746
FreshRSS#1745
FreshRSS#1744

[doc] Editing for better style (FreshRSS#1736)

* Also removed references to Persona authentication.
* Changed code comment about Persona because it's for HTTP auth
  in general. See FreshRSS@3d87609
  and FreshRSS#358 (comment)
[i18n] Add translation ignore/nl (FreshRSS#1752)


Add shortcuts to switch views (FreshRSS#1755)


Add mute strategy configuration (FreshRSS#1750)


Minor syntax

Merge pull request FreshRSS#1714 from kevinpapst/hook-readingmodes

Added extension hook for reading modes
Changelog 1739, 1745, 1750, 1755

FreshRSS#1739
FreshRSS#1745
FreshRSS#1750
FreshRSS#1755

Fix login bug when HTTP REMOTE_USER changes

YunoHost-Apps/freshrss_ynh#33

Merge pull request FreshRSS#1756 from Alkarex/YunoHost_HTTP_Auth

Fix login bug when HTTP REMOTE_USER changes
Changelog 1756

FreshRSS#1756
YunoHost-Apps/freshrss_ynh#33

Merge branch 'dev' of https://github.com/FreshRSS/FreshRSS into FreshRSS/dev

Fix shortcuts triggering view switching

Merge pull request FreshRSS#1758 from aledeg/fix-nav-buttons

Fix shortcuts triggering view switching
Merge branch 'dev' into github-update
Merge branch 'dev' into github-update
@aledeg aledeg mentioned this pull request Jan 13, 2018
@Alkarex Alkarex modified the milestones: 1.11.0, 1.10.0 Feb 5, 2018
@Alkarex Alkarex mentioned this pull request Feb 14, 2018
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Mar 23, 2021
* Minor auto-update in version 1.10.0 (3 years old) FreshRSS#1750
    * Related to FreshRSS#3552
* Auto-update for temporary table in version 1.7.0 () FreshRSS#1470 (4 years old)
mdemoss pushed a commit to mdemoss/FreshRSS that referenced this pull request Mar 25, 2021
mdemoss pushed a commit to mdemoss/FreshRSS that referenced this pull request Mar 25, 2021
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Sep 1, 2023
Remove `updateTTL` function used to help migration to 5+ year-old FreshRSS 1.10 and FreshRSS 0.7.3 FreshRSS#1750
This function contributed to locking the database FreshRSS#5574
Subset of FreshRSS#3558
Alkarex added a commit that referenced this pull request Sep 6, 2023
Remove `updateTTL` function used to help migration to 5+ year-old FreshRSS 1.10 and FreshRSS 0.7.3 #1750
This function contributed to locking the database #5574
Subset of #3558
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants