Commit Graph

162 Commits

Author SHA1 Message Date
ChunkyProgrammer 7822f7423e
Remove console.logs (#2606)
* remove console.logs

* use 'off' instead of 0
2022-09-23 09:04:10 +08:00
Aiz e90b9f4706
Improve premiere timestamp to be easier to read (#2559)
* Improve premiere timestamp

Removes the unesseccary parts of the timestamp, year and seconds.

displays month as long name (eg., March)

* fix linting... forgot to add the file again before commit.

* get and use current locale set in freetube

this fixes issues where os locale and freetube locale don't match

* use 'default' when no locale is set in freetube.

this defaults to system locale

* use i18n to get locale and format date with intl

* format date with intl.datetimeformat

forgot to add file again after changes...

* display year if current year is less than year of premiere date
2022-09-22 08:49:59 +08:00
absidue 061a7c8db1
Replace jquery getJSON and get with native fetch (#2591)
* Replace jquery getJSON and get with native fetch

* Remove unnecessary console.log
2022-09-21 07:05:03 +00:00
Emma 25d954f990
Cleaning up calls to the Clipboard API (#2597)
* Added a copyToClipboard function to utils

This should make it easier to handle errors which
result from the clipboard API (which are more likely
in web builds). This should also make it easier to handle
copying to clipboard in cordova builds by abstracting the
platform specific code out of the views and moving it
all into one function.

* Moved the $t function out of utils

* Removing locale snippets I was using and am not now

* Added function comment to copyToClipboard

* Adding some missing references

* Adding an additional check

* Re-reviewing my changes, I found a mistake

* Update src/renderer/store/modules/utils.js

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Update static/locales/en-US.yaml

Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>

* Reverting the language back to what it was previously

* Switching to using i18n.t()

instead of handling the translations myself.
Also, it looks like eslint removed a tab.

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
2022-09-21 15:00:21 +08:00
Aiz 7f6834d8f6
set height of watch page grid with auto in dual-column-template (#2588)
this ensures the page doesn't keep scrolling forever if live chat is enabled and recommended videos is disabled
2022-09-20 14:31:25 +00:00
absidue 76a9e5c3c4
Fix the localised description containing broken URLs (#2572)
* Fix the localised description containing broken URLs

* Fix hashtag handling in title and description
2022-09-19 08:49:30 -04:00
ChunkyProgrammer 8fa182e246
Properly localize numbers (#2557)
* localize numbers properly

* Remove tostring

Co-authored-by: Aiz <66974576+Aiz0@users.noreply.github.com>

Co-authored-by: Aiz <66974576+Aiz0@users.noreply.github.com>
2022-09-19 20:14:53 +08:00
absidue f2d2827e0f
Fix some web issues and cleanup (#2582) 2022-09-17 08:19:31 +00:00
absidue 62829b736a
Electron variable at build time instead of at runtime (#2574) 2022-09-15 08:59:09 +00:00
Emma 77470751c3
Localization inconsistency fix for Local API (#2535)
* Applying a workaround for localization issue

This changes where the title comes from on the response object from ytdl.
This is related to FreeTubeApp#2530.

* Applying the same workaround on the description

* Added a fallback to videoDetails

* Adding a console error to the title try block

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Simplifying a loop to Array.join

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Adding a console error to the description try block

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Add a map for the description lines

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Added a question mark operator for descriptions

This should prevent errors from erroneously being thrown on videos
which have a blank description. If the description is undefined or does
not contain a 'runs' field, the resulting descriptionLines should be
and empty array. Then, videoDescription will be an empty string.

* Each line already contains a `\n`

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
2022-09-09 13:39:56 -04:00
absidue eaa15ea833
Webpack bundle dependencies (#2511)
* Allow webpack to bundle *most* dependencies

* Exclude *most* node_modules from getting packaged by electron-builder

* Import only the required icons instead of bundling the whole icon pack

* Reduce packaging blacklist to only include the few things that still need blacklisting
2022-09-06 02:29:10 +00:00
Aiz c784841b22
Display time remaining until video goes live (#2501)
* display time left until video premiers:

* video premiere display time left with time units

Displays time left in seconds, minutes, hours, and days.

This depends on how much time is left.

* premiere time left, display time in singular if needed

also simplified the big if block

* premiere time left, display time unit in lowercase

* Add Starting Soon string to locale file

* apply fixes reported by linter

* premiere time left, add suggested changes

Better temp variable scoping, flatten nested code, rename temp variables, use string intepolation

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* replace tabs with spaces

tabs where used in some places in the suggested code

* display time left, remove "starting soon" string

Since upcomingTimeStamp will be null when the time has passed the scheduled timestamp
it doesn't make sense to use something that will rarely be displayed.
e.g. a user has to click on the video with less than a second remaing until it goes live for it to be displayed

it would also be displayed as "Premieres in Starting soon" which doesn't make sense

* display 'less than a minute' instead of exactly how many seconds remain

Looks better and works for values less than 0

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2022-09-05 23:45:45 +02:00
MarmadileManteater 166fe004b2
This should eliminate this race condition by using (#2493)
the seconds length value provided by the API
rather than trying to pull the time from the video
element. This is related to FreeTubeApp#2492 and
MarmadileManteater#9.
2022-08-20 14:49:41 +02:00
Preston 22dd5baf23
Respect autoplay playlists setting (#2430) 2022-07-31 15:37:34 -04:00
absidue 01cfbe7b1e
Fix scrolling through the download dropdown (#2426)
* Fix scrolling through the download dropdown

* Fix lining issue
2022-07-31 10:08:49 -04:00
ChunkyProgrammer 3321fa91e4
Add Parental Controls (#1456)
* start to implement some parental controls

* Hide share + Hide Unsubscribe

* Hide live streams

* fix hide live streams

* Add "parental-control-settings"

* Implement Hide Live Streams & Hide "Age Restricted"

* Hide live streams from Subscriptions + fix hide live streams from search

* enable safe search on showFamilyFriendlyOnly

* Move some settings from parental control to distraction free

* fix channel loading

* make parental control settings collapsible

* fix lint

* dont show age restricted on videos that are loading

* improve hide live videos

* code refactor

* grammar

* nvm im dumb

* use named placeholder for age restricted message

* improve readability

* change Hide Description to Hide Video Description

* update translated strings

* fix age restricted component

Co-authored-by: Preston <freetubeapp@protonmail.com>
Co-authored-by: peepopoggers <72892531+peepopoggers@users.noreply.github.com>
2022-06-21 08:14:15 +02:00
absidue 35dcdbac10
Fix removing the meta files when navigating to a new video (#2344) 2022-06-20 22:33:42 -04:00
luzpaz 3440ee507c
Fix misc. typos (#2311)
Found via `codespell -q 3 -S ./yarn.lock,./static/geolocations,./static/locales -L te`
2022-06-13 21:31:32 +08:00
ChunkyProgrammer 74dc309803
Fix: Update thumbnail url and channel name for subscriptions when change detected (#1783)
* Update thumbnails of subscriptions

* refactor

* update channel names

* movie update thumbnail action to profiles.js

* fix updating with invidious

* apply code changes

* simplify update condition logic

* remove unneeded variables

* inline variables, use for of

* fix channel null check
2022-06-03 12:52:35 +00:00
vallode 8d5aa4d855
Remove usage of fixed positioning for core UI elements (#2284)
* Use flex positioning instead of fixed

* Remove expand class

* Fix sticky description on video in mobile

* Sort CSS properties
2022-06-03 12:01:26 +00:00
bob1520 c098014a4e
Fix caption baseurl (#2268)
* fix caption

* remove duplicate auto-translation from english
2022-05-26 22:46:49 -04:00
preston 20a65a6400 Fix small errors that would come up during usage 2022-05-14 21:05:14 -04:00
absidue 1e5895a8c6
Hide Picture in Picture button and disable shortcut for audio formats (#2227) 2022-05-02 19:50:23 +08:00
absidue e10c12e55b
Allow DASH formats for livestream replays (#2208) 2022-04-24 10:02:26 +08:00
ChunkyProgrammer e61c11a7ef
Feature: Add pinned, owner and reply from owner indicators for comments (#1795)
* Add pinned, owner and reply from owner indicators

* fix locale

* show owner for invidious

* add margin to pinned indicator

* show owner indicator for replies

* don't show "from owner and others" on hide

* Pass variable into translated string

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* fix replacing channelName

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2021-11-06 10:11:21 +08:00
PrestonN 6519b054c6 Add check for format.resolution in Invidious adaptive formats 2021-10-13 23:11:51 -04:00
PrestonN 2acd3261c4 Fix issue where Invidious DASH files were not being played correctly. 2021-10-12 17:03:22 -04:00
PikachuEXE 07fd93d3aa
Fix watching video in development (#1668)
* Fix watching watched video in development

* Fix removing a file even when it does not exist (and would raise error)

* Fix infinite reload in video watching

File updates (e.g. dashFiles) in static folder triggers app reload (web-dev-server)
But the a file is created/updated/deleted on before playing any video
So it goes into a loop of loading a video
2021-09-23 07:04:00 +00:00
Jason f801ea4b05
Integrate theater mode into mediaplayer (#1589)
* Moves theatre mode button to mediaplayer

* Accounts for 'Enable Theatre Mode by Default'

* Removes unnecessary comment

* Removes unnecessary newlines

* Rename variable for toggle theatre mode button

* Fix issue caused by missing change in rename

Co-authored-by: Preston <freetubeapp@protonmail.com>
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2021-08-24 07:36:10 +00:00
PrestonN d4953525b2 Fix issue with videos not loading when running in dev mode 2021-07-17 20:24:26 -04:00
Svallinn 40d7278383
Invidious: Randomize instance on startup
There are now two separate settings related to Invidious instances:
- currentInvidiousInstance
- defaultInvidiousInstance

'currentInvidiousInstance' is a value that exists solely in memory
and it's the value used by the app to make the API calls,
while 'defaultInvidiousInstance' is the value that can be persisted
in the database by user action and will be used to initiate
the 'currentInvidiousInstance' on startup.

If the user has not saved a default value to the database,
'currentInvidiousInstance' is randomized from
a fetched list of viable candidates.
2021-07-03 02:55:56 +01:00
PikachuEXE ce15f4b7c4
Watch: stop autoplay countdown toasts when navigating to another page (#1287) 2021-06-14 18:10:21 +00:00
kuhaku 52fa523df1
Add support for External Players (closes #418) (#1271)
* feat: add support for opening videos/playlists in external players (like mpv) #418

Signed-off-by: Randshot <randshot@norealm.xyz>

* feat: move external player settings into own section
feat: add warnings for when the external player doesn't support the current action (e.g. reversing playlists)
feat: add toggle in settings for ignoring unsupported action warnings

Signed-off-by: Randshot <randshot@norealm.xyz>

* improvement: do not append start offset argument when the watch progress is 0

Signed-off-by: Randshot <randshot@norealm.xyz>

* fix: fix undefined showToast error when clicking on the external player playlist button

Signed-off-by: Randshot <randshot@norealm.xyz>

* feat: add icon button for external player to watch-video-info (below video player) component
improvement: refactor the code for opening the external player into a separate function in utils.js

Signed-off-by: Randshot <randshot@norealm.xyz>

* feat: add support for ytdl protocol urls (supportsYtdlProtocol)
chore: fix lint error

Signed-off-by: Randshot <randshot@norealm.xyz>

* feat: add support for passing default playback rate to external player
improvement: add warning message for when the external player does not support starting playback at
             a given offset
chore: rename reverse, shuffle, and loopPlaylist fields for consistency

Signed-off-by: Randshot <randshot@norealm.xyz>

* feat: add setting for custom external player command line arguments

Signed-off-by: Randshot <randshot@norealm.xyz>

* chore: fix lint error

Signed-off-by: Randshot <randshot@norealm.xyz>

* improvement(watch-video-info.js): change the default for playlistId back to null (consistent with other occurrences)
improvement(utils.js/openInExternalPlayer): also check for empty playlistId string
fix(watch-video-info.js): fix merge error

Signed-off-by: Randshot <randshot@norealm.xyz>

* improvement(components/ft-list-video): check whether watch history is turned on, before adding a video to it
fix(store/utils): fix playlistReverse typo, causing `undefined` being set as a command line argument
fix(store/utils): check for 'string' type, instead of `null` and `undefined`
fix(views/Watch): fix getPlaylistIndex returning an incorrect index, when reverse was turned on
chore(locales/en-US): fix thumbnail and suppress typo
chore(locales/en_GB): fix thumbnail and suppress typo

Signed-off-by: Randshot <randshot@norealm.xyz>

* feat: pause player when opening video in external player

Signed-off-by: Randshot <randshot@norealm.xyz>

* feat(externalPlayer): refactor externalPlayerCmdArguments into a separate static file `static/external-player-map.json`
chore(components/ft-list-video): fix lint error

Signed-off-by: Randshot <randshot@norealm.xyz>

* Revert "feat: pause player when opening video in external player"

This reverts commit 28b4713334.

* feat: pause the app's player when opening video in external player

* This commit addresses above requested changes.

improvement(components/external-player-settings): move `externalPlayer` check to `ft-flex-box`
improvement(components/external-player-settings): use `update*` methods, instead of `handle*`

improvement(store/utils): move child_process invocation to `main/index.js` via IPC call to renderer
improvement(store/utils): use `dispatch` for calling actions
improvement(store/utils): get external player related settings directly in the action

improvement(renderer/App): move `checkExternalPlayer` call down into `usingElectron` if statement
fix(renderer/App): fix lint error

improvement(components/ft-list-playlist): remove unnecessary payload fields
fix(components/ft-list-playlist): fix typo in component name

improvement(components/ft-list-video): remove unnecessary payload fields

improvement(components/watch-video-info): remove unnecessary payload fields
improvement(views/Settings): add `usingElectron` condition

Signed-off-by: Randshot <randshot@norealm.xyz>

* fix(store/utils): fix toast message error

Signed-off-by: Randshot <randshot@norealm.xyz>

* fix(store/utils): fix a few code mess-ups

Co-authored-by: Svallinn <41585298+Svallinn@users.noreply.github.com>
2021-06-13 17:31:43 +02:00
PikachuEXE 70aa159bb8
Update "Open Link" button to include playlist ID (#1258)
* ! Fix app unable to load due to missing `getLocale` in `mapActions`

* $ Update a function's name with incorrect name casing

* Update "open youtube link" button to open with playlist when playing a video with an active playlist
2021-05-25 19:39:34 +02:00
Svallinn 6ccc7e9fa4
Refactor: Swap `dispatch`/`commit` calls with mapped actions/mutations 2021-05-22 00:56:32 +01:00
Svallinn af0353ea32
Refactor: Erase `@electron/remote` references and other dangerous calls
The `remote` module is deprecated and `@electron/remote` is unnecessary,
since the `ipcMain` and `ipcRenderer` can replace their functionality,
providing better performance and better security.

All other dangerous calls (mainly pulling main process constructs into
the renderer process) have also been removed.
2021-05-22 00:49:48 +01:00
Preston 8f8df5d8e6 Fix quality changing logic for Invidious API 2021-05-16 21:40:34 -04:00
Filip Czaplicki 440b04bbf0
SponsorBlock (#1130)
* SponsorBlock: enable/url settings

* SponsorBlock: fetch and display skipped fragments

* SponsorBlock: skip sponsor blocks

* npm add node-forge

* SponsorBlock: use hash prefix API

* SponsorBlock: configurable toast on skipped segment

* SponsorBlock: add /api/ to url, remove trailing slash
2021-05-16 16:01:24 -04:00
Preston 176d81dd6b Fix quality logic again 2021-05-15 15:08:41 -04:00
Svallinn f2d29f667a
Captions: Fix 'system' locale unwanted behavior
Closes: #1268

Having 'system' locale set would wrongfully send the wrong
locale information to YouTube, which would result in the captions
not being set properly. This commit fixes that behavior.
2021-05-11 18:25:47 +01:00
Preston 29cdae7f8e Fix issue with recent live streams not being playable and update credits link in about 2021-04-30 17:43:12 -04:00
Preston 689479eb21 Channel Fixes and finish quality change logic 2021-04-30 17:18:45 -04:00
Svallinn e696af3f7a
Apply playlist autoplay interval to regular autoplay
The interval to play the next video in a playlist was dynamic and
wasn't applied to the normal autoplay timer.
This commit merges the logic of these two scenarios so that they both
utilize the user-defined interval.
2021-04-29 19:33:13 +01:00
PikachuEXE 76260d9c4c
* Implement playlist countdown per second (#1234)
Closes: #1214
2021-04-29 16:58:00 +00:00
Svallinn c8d96d38b6
Save watch progress when closing window (#1217) 2021-04-21 18:38:46 +00:00
Luca 49aab11acb Svallinns locale fix 2021-04-12 23:00:07 +02:00
Luca Hohmann edb6de2e88
Merge pull request #1121 from Svallinn/improved-captions
Overhaul of the captions subsystem
2021-04-10 21:20:27 +02:00
Luca Hohmann c5fac9fcd7
Video meta file removal option (#1154)
* Implemented video meta file removal option

* Lint fix
2021-04-01 15:54:45 +02:00
Svallinn 39811f6ee4
Change locale caption function name 2021-03-19 19:18:21 +00:00
Svallinn becf86e945
Provide translated caption for user's locale 2021-03-19 18:43:16 +00:00