Commit Graph

182 Commits

Author SHA1 Message Date
ChunkyProgrammer 43a25f8738
update linters & add stylelint (#3023)
* update linters, add stylelint, switch from sass to scss

* remove unused babel-eslint module

* fix spacing in scss files

* dont use npm in script calls

* dont error for `:deep` selector in css
2023-01-03 19:19:41 +01:00
absidue 47613d8c37
Fix no sources error on the watch page (#3019) 2023-01-02 10:03:21 +08:00
absidue 2f01dd4277
Parse channel handles in video descriptions (#3011) 2022-12-31 11:07:53 +01:00
absidue 1d1e6eacea
Switch from sync fs APIs to fs/promises (#2991)
* Switch from sync fs APIs to fs/promises

* Fix error and await storyboard creation

* Start a new file for filesystem helpers starting with pathExists
2022-12-29 01:19:48 +00:00
ChunkyProgrammer 42ef2a3e26
Improve accessibility of Watch View (#2986)
* Improve Watch page accessibility

Co-Authored-By: Jason <84899178+jasonhenriquez@users.noreply.github.com>

* fix title issue, remove unused gotochannel function

Co-authored-by: Jason <84899178+jasonhenriquez@users.noreply.github.com>
2022-12-23 16:44:54 +00:00
absidue a88bafeb27
Make getUserDataPath, getPicturesPath and getSystemLocale helpers (#2920) 2022-12-06 12:37:44 +01:00
absidue 5addd304ef
Localise subscriber count on the watch page (#2841) 2022-11-08 11:47:02 +00:00
absidue 56416700bc
Allow webpack to omit development only dependencies properly (#2828) 2022-11-05 14:44:21 +00:00
absidue e228182d8a
Move openInternalPath and formatDurationAsTimestamp to utils (#2794)
* Move openInternalPath and formatDurationAsTimestamp to utils

* Make openInternalPath take an object parameter again

* Fix small mistake
2022-11-04 07:19:51 +00:00
absidue 8f55a648b1
Cleanup unused component imports (#2773) 2022-10-27 09:34:39 +00:00
absidue 2c78970f0e
Fix chapters extraction erroring (#2774) 2022-10-27 09:34:04 +00:00
absidue f970936d1e
Make copyToClipboard and openExternalLink helpers (#2722) 2022-10-18 08:15:28 +00:00
Emma b5c486bf1f
Fixing some leftover `showToast(obj)` (#2735) 2022-10-17 12:33:20 +00:00
absidue 3aa080d707
Make showToast a helper (#2695) 2022-10-14 05:59:49 +00:00
absidue 22a5062334
Move calculateColorLuminance, calculatePublishedDate and buildVTTFileLocally out of the store (#2692) 2022-10-10 07:45:18 +00:00
absidue 5677c3182d
Remove jquery from the ft-player component (#2647) 2022-10-05 08:25:50 +00:00
absidue bc886af726
Implement chapters (#2224)
* Implement chapters

* Generate chapters locally for the Invidious API backend

* Performance improvements

* More performance improvements

* Improve chapters appearance and add compact mode for Invidious

* Update UI while seeking instead of afterwards

* Invidious extract chapters with range timestamps properly and duplicate chapters

* Minor code improvement

* Add accessibility labels and keyboard navigation

* Add chapter markers

* Fix missing newline at the bottom of ft-video-player.css

* Fix marker placement
2022-09-29 20:01:54 +00:00
Aiz 498ae77ade
Improve styling of premiere date box (#2611)
* use 5px border radius instead of 5%

a 5% border radius will create an oval shape when height and width differ.
this doesn't look good.
5px radius looks better and is used in other places

* offset premiereDate by 12px from bottom left

Increases the offset a tiny amount and adds a left offset aswell.
This looks better than when it was previously only offset from the bottom.
I used 12px because it's what youtube uses.

* use flexbox to align items additional positioning with margins

vertically centes premiere icon and text with by making their parent a flexbox

sets a min width for the text instead of using a set width for the premiereDate

* change font size and weight of timestamp text

* remove uneeded line height styling

line height 1.2 did not affect anything

* fix indentation

* Update src/renderer/views/Watch/Watch.sass

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

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
2022-09-27 07:19:35 +08:00
absidue fa8d423bc6
Fix some development code not getting optimised out (#2605) 2022-09-26 16:15:13 -04:00
Aiz c9c522a2b1
Use Intl.RelativeTimeFormat() for premiere upcoming time left (#2610)
* 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...

* use intl relative time format to format upcomingTimeLeft

* rename timeUnitI18nKey to just timeUnit

It's no longer used as a key and is no longer partial
2022-09-24 23:23:45 +00:00
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