Merge branch 'master' into groupcoverlimit

This commit is contained in:
mx03 2022-01-22 11:26:23 +01:00
commit a9eb64fdc6
60 changed files with 1650 additions and 545 deletions

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Audiobookshelf Self-hosted audiobook server
Copyright (C) 2021 advplyr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Audiobookshelf Copyright (C) 2021 advplyr
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -2,6 +2,8 @@
set -e set -e
set -o pipefail set -o pipefail
FFMPEG_INSTALL_DIR="/usr/lib/audiobookshelf-ffmpeg/"
declare -r init_type='auto' declare -r init_type='auto'
declare -ri no_rebuild='0' declare -ri no_rebuild='0'
@ -81,5 +83,6 @@ add_user 'audiobookshelf' '' 'audiobookshelf' 'audiobookshelf user-daemon' '/bin
mkdir -p '/var/log/audiobookshelf' mkdir -p '/var/log/audiobookshelf'
chown -R 'audiobookshelf:audiobookshelf' '/var/log/audiobookshelf' chown -R 'audiobookshelf:audiobookshelf' '/var/log/audiobookshelf'
chown -R 'audiobookshelf:audiobookshelf' '/usr/share/audiobookshelf' chown -R 'audiobookshelf:audiobookshelf' '/usr/share/audiobookshelf'
chown -R 'audiobookshelf:audiobookshelf' "$FFMPEG_INSTALL_DIR"
start_service 'audiobookshelf' start_service 'audiobookshelf'

View File

@ -2,6 +2,7 @@
set -e set -e
set -o pipefail set -o pipefail
FFMPEG_INSTALL_DIR="/usr/lib/audiobookshelf-ffmpeg/"
DEFAULT_AUDIOBOOK_PATH="/usr/share/audiobookshelf/audiobooks" DEFAULT_AUDIOBOOK_PATH="/usr/share/audiobookshelf/audiobooks"
DEFAULT_DATA_PATH="/usr/share/audiobookshelf" DEFAULT_DATA_PATH="/usr/share/audiobookshelf"
DEFAULT_PORT=7331 DEFAULT_PORT=7331
@ -12,20 +13,17 @@ install_ffmpeg() {
echo "Starting FFMPEG Install" echo "Starting FFMPEG Install"
WGET="wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz" WGET="wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz"
TARGET_DIR="/usr/lib/audiobookshelf-ffmpeg/"
if ! cd "$TARGET_DIR"; then if ! cd "$FFMPEG_INSTALL_DIR"; then
echo "WARNING: can't access working directory ($TARGET_DIR) creating it" >&2 echo "WARNING: can't access working directory ($FFMPEG_INSTALL_DIR) creating it" >&2
mkdir "$TARGET_DIR" mkdir "$FFMPEG_INSTALL_DIR"
cd "$TARGET_DIR" cd "$FFMPEG_INSTALL_DIR"
fi fi
$WGET $WGET
tar xvf ffmpeg-git-amd64-static.tar.xz --strip-components=1 tar xvf ffmpeg-git-amd64-static.tar.xz --strip-components=1
rm ffmpeg-git-amd64-static.tar.xz rm ffmpeg-git-amd64-static.tar.xz
chown -R 'audiobookshelf:audiobookshelf' "$TARGET_DIR"
echo "Good to go on Ffmpeg... hopefully" echo "Good to go on Ffmpeg... hopefully"
} }
@ -83,6 +81,7 @@ setup_config_interactive() {
METADATA_PATH=$DATA_PATH/metadata METADATA_PATH=$DATA_PATH/metadata
CONFIG_PATH=$DATA_PATH/config CONFIG_PATH=$DATA_PATH/config
FFMPEG_PATH=/usr/lib/audiobookshelf-ffmpeg/ffmpeg FFMPEG_PATH=/usr/lib/audiobookshelf-ffmpeg/ffmpeg
FFPROBE_PATH=/usr/lib/audiobookshelf-ffmpeg/ffprobe
PORT=$PORT" PORT=$PORT"
echo "$config_text" echo "$config_text"
@ -105,6 +104,7 @@ setup_config() {
METADATA_PATH=$DEFAULT_DATA_PATH/metadata METADATA_PATH=$DEFAULT_DATA_PATH/metadata
CONFIG_PATH=$DEFAULT_DATA_PATH/config CONFIG_PATH=$DEFAULT_DATA_PATH/config
FFMPEG_PATH=/usr/lib/audiobookshelf-ffmpeg/ffmpeg FFMPEG_PATH=/usr/lib/audiobookshelf-ffmpeg/ffmpeg
FFPROBE_PATH=/usr/lib/audiobookshelf-ffmpeg/ffprobe
PORT=$DEFAULT_PORT" PORT=$DEFAULT_PORT"
echo "$config_text" echo "$config_text"

View File

@ -32,6 +32,7 @@ echo "--------------------"
# Create debian control file # Create debian control file
mkdir -p dist mkdir -p dist
rm -rf dist/debian
cp -R build/debian dist/debian cp -R build/debian dist/debian
chmod -R 775 dist/debian chmod -R 775 dist/debian

View File

@ -18,6 +18,7 @@
} }
#bookshelf { #bookshelf {
height: calc(100% - 40px); height: calc(100% - 40px);
background-image: linear-gradient(to right bottom, #2e2e2e, #303030, #313131, #333333, #353535, #343434, #323232, #313131, #2c2c2c, #282828, #232323, #1f1f1f);
} }
@media (max-width: 768px) { @media (max-width: 768px) {
#bookshelf { #bookshelf {
@ -25,6 +26,10 @@
} }
} }
#page-wrapper {
background-image: linear-gradient(to right bottom, #2e2e2e, #303030, #313131, #333333, #353535, #343434, #323232, #313131, #2c2c2c, #282828, #232323, #1f1f1f);
}
/* width */ /* width */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
@ -121,10 +126,6 @@ input[type=number] {
font-size: 1.1rem; font-size: 1.1rem;
} }
#page-wrapper {
background-image: linear-gradient(to right bottom, #2e2e2e, #303030, #313131, #333333, #353535, #343434, #323232, #313131, #2c2c2c, #282828, #232323, #1f1f1f);
}
.box-shadow-md { .box-shadow-md {
box-shadow: 2px 8px 6px #111111aa; box-shadow: 2px 8px 6px #111111aa;
} }

View File

@ -15,7 +15,7 @@
<span v-if="showExperimentalFeatures" class="material-icons text-4xl text-warning pr-0 sm:pr-2 md:pr-4">logo_dev</span> <span v-if="showExperimentalFeatures" class="material-icons text-4xl text-warning pr-0 sm:pr-2 md:pr-4">logo_dev</span>
<nuxt-link v-if="isRootUser" to="/config/stats" class="outline-none hover:text-gray-200 cursor-pointer w-8 h-8 flex items-center justify-center mx-1"> <nuxt-link to="/config/stats" class="outline-none hover:text-gray-200 cursor-pointer w-8 h-8 flex items-center justify-center mx-1">
<span class="material-icons">equalizer</span> <span class="material-icons">equalizer</span>
</nuxt-link> </nuxt-link>

View File

@ -3,29 +3,10 @@
<div class="md:hidden flex items-center justify-end pb-2 px-4 mb-1" @click="closeDrawer"> <div class="md:hidden flex items-center justify-end pb-2 px-4 mb-1" @click="closeDrawer">
<span class="material-icons text-2xl">arrow_back</span> <span class="material-icons text-2xl">arrow_back</span>
</div> </div>
<nuxt-link to="/config" class="w-full px-4 h-12 border-b border-opacity-0 flex items-center cursor-pointer relative" :class="routeName === 'config' ? 'bg-primary bg-opacity-70' : 'hover:bg-primary hover:bg-opacity-30'">
<p>Settings</p> <nuxt-link v-for="route in configRoutes" :key="route.id" :to="route.path" class="w-full px-4 h-12 border-b border-opacity-0 flex items-center cursor-pointer relative" :class="routeName === route.id ? 'bg-primary bg-opacity-70' : 'hover:bg-primary hover:bg-opacity-30'">
<div v-show="routeName === 'config'" class="h-full w-0.5 bg-yellow-400 absolute top-0 left-0" /> <p>{{ route.title }}</p>
</nuxt-link> <div v-show="routeName === route.iod" class="h-full w-0.5 bg-yellow-400 absolute top-0 left-0" />
<nuxt-link to="/config/libraries" class="w-full px-4 h-12 border-b border-opacity-0 flex items-center cursor-pointer relative" :class="routeName === 'config-libraries' ? 'bg-primary bg-opacity-70' : 'hover:bg-primary hover:bg-opacity-30'">
<p>Libraries</p>
<div v-show="routeName === 'config-libraries'" class="h-full w-0.5 bg-yellow-400 absolute top-0 left-0" />
</nuxt-link>
<nuxt-link to="/config/users" class="w-full px-4 h-12 border-b border-opacity-0 flex items-center cursor-pointer relative" :class="routeName === 'config-users' ? 'bg-primary bg-opacity-70' : 'hover:bg-primary hover:bg-opacity-30'">
<p>Users</p>
<div v-show="routeName === 'config-users'" class="h-full w-0.5 bg-yellow-400 absolute top-0 left-0" />
</nuxt-link>
<nuxt-link to="/config/backups" class="w-full px-4 h-12 border-b border-opacity-0 flex items-center cursor-pointer relative" :class="routeName === 'config-backups' ? 'bg-primary bg-opacity-70' : 'hover:bg-primary hover:bg-opacity-30'">
<p>Backups</p>
<div v-show="routeName === 'config-backups'" class="h-full w-0.5 bg-yellow-400 absolute top-0 left-0" />
</nuxt-link>
<nuxt-link to="/config/log" class="w-full px-4 h-12 border-b border-opacity-0 flex items-center cursor-pointer relative" :class="routeName === 'config-log' ? 'bg-primary bg-opacity-70' : 'hover:bg-primary hover:bg-opacity-30'">
<p>Log</p>
<div v-show="routeName === 'config-log'" class="h-full w-0.5 bg-yellow-400 absolute top-0 left-0" />
</nuxt-link>
<nuxt-link to="/config/stats" class="w-full px-4 h-12 border-b border-opacity-0 flex items-center cursor-pointer relative" :class="routeName === 'config-stats' ? 'bg-primary bg-opacity-70' : 'hover:bg-primary hover:bg-opacity-30'">
<p>Stats</p>
<div v-show="routeName === 'config-stats'" class="h-full w-0.5 bg-yellow-400 absolute top-0 left-0" />
</nuxt-link> </nuxt-link>
<div class="w-full h-10 px-4 border-t border-black border-opacity-20 absolute left-0 flex flex-col justify-center" :style="{ bottom: streamAudiobook && windowHeight > 700 && !isMobile ? '300px' : '65px' }"> <div class="w-full h-10 px-4 border-t border-black border-opacity-20 absolute left-0 flex flex-col justify-center" :style="{ bottom: streamAudiobook && windowHeight > 700 && !isMobile ? '300px' : '65px' }">
@ -47,6 +28,57 @@ export default {
} }
}, },
computed: { computed: {
userIsRoot() {
return this.$store.getters['user/getIsRoot']
},
configRoutes() {
if (!this.userIsRoot) {
return [
{
id: 'config-stats',
title: 'Your Stats',
path: '/config/stats'
}
]
}
return [
{
id: 'config',
title: 'Settings',
path: '/config'
},
{
id: 'config-libraries',
title: 'Libraries',
path: '/config/libraries'
},
{
id: 'config-users',
title: 'Users',
path: '/config/users'
},
{
id: 'config-backups',
title: 'Backups',
path: '/config/backups'
},
{
id: 'config-log',
title: 'Log',
path: '/config/log'
},
{
id: 'config-library-stats',
title: 'Library Stats',
path: '/config/library-stats'
},
{
id: 'config-stats',
title: 'Your Stats',
path: '/config/stats'
}
]
},
wrapperClass() { wrapperClass() {
var classes = [] var classes = []
if (this.drawerOpen) classes.push('translate-x-0') if (this.drawerOpen) classes.push('translate-x-0')

View File

@ -1,11 +1,11 @@
<template> <template>
<div id="bookshelf" class="w-full overflow-y-auto"> <div id="bookshelf" class="w-full overflow-y-auto">
<template v-for="shelf in totalShelves"> <template v-for="shelf in totalShelves">
<div :key="shelf" class="w-full px-4 sm:px-8 bookshelfRow relative" :id="`shelf-${shelf - 1}`" :style="{ height: shelfHeight + 'px' }"> <div :key="shelf" :id="`shelf-${shelf - 1}`" class="w-full px-4 sm:px-8 relative" :class="{ bookshelfRow: !isAlternativeBookshelfView }" :style="{ height: shelfHeight + 'px' }">
<!-- <div class="absolute top-0 left-0 bottom-0 p-4 z-10"> <!-- <div class="absolute top-0 left-0 bottom-0 p-4 z-10">
<p class="text-white text-2xl">{{ shelf }}</p> <p class="text-white text-2xl">{{ shelf }}</p>
</div> --> </div> -->
<div class="bookshelfDivider w-full absolute bottom-0 left-0 right-0 z-20" :class="`h-${shelfDividerHeightIndex}`" /> <div v-if="!isAlternativeBookshelfView" class="bookshelfDivider w-full absolute bottom-0 left-0 right-0 z-20" :class="`h-${shelfDividerHeightIndex}`" />
</div> </div>
</template> </template>
@ -18,6 +18,9 @@
</div> </div>
<div v-else-if="!totalShelves && initialized" class="w-full py-16"> <div v-else-if="!totalShelves && initialized" class="w-full py-16">
<p class="text-xl text-center">{{ emptyMessage }}</p> <p class="text-xl text-center">{{ emptyMessage }}</p>
<div class="flex justify-center mt-2">
<ui-btn v-if="hasFilter" color="primary" @click="clearFilter">Clear Filter</ui-btn>
</div>
</div> </div>
<widgets-cover-size-widget class="fixed bottom-4 right-4 z-30" /> <widgets-cover-size-widget class="fixed bottom-4 right-4 z-30" />
@ -86,6 +89,7 @@ export default {
emptyMessage() { emptyMessage() {
if (this.page === 'series') return `You have no series` if (this.page === 'series') return `You have no series`
if (this.page === 'collections') return "You haven't made any collections yet" if (this.page === 'collections') return "You haven't made any collections yet"
if (this.hasFilter) return `No Results for filter "${this.filterValue}"`
return 'No results' return 'No results'
}, },
entityName() { entityName() {
@ -104,15 +108,33 @@ export default {
coverAspectRatio() { coverAspectRatio() {
return this.$store.getters['getServerSetting']('coverAspectRatio') return this.$store.getters['getServerSetting']('coverAspectRatio')
}, },
bookshelfView() {
return this.$store.getters['getServerSetting']('bookshelfView')
},
isCoverSquareAspectRatio() { isCoverSquareAspectRatio() {
return this.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE return this.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE
}, },
isAlternativeBookshelfView() {
if (!this.isEntityBook) return false // Only used for bookshelf showing books
return this.bookshelfView === this.$constants.BookshelfView.TITLES
},
bookCoverAspectRatio() { bookCoverAspectRatio() {
return this.isCoverSquareAspectRatio ? 1 : 1.6 return this.isCoverSquareAspectRatio ? 1 : 1.6
}, },
hasFilter() { hasFilter() {
return this.filterBy && this.filterBy !== 'all' return this.filterBy && this.filterBy !== 'all'
}, },
filterName() {
if (!this.filterBy) return ''
var filter = this.filterBy.split('.')[0]
filter = filter.substr(0, 1).toUpperCase() + filter.substr(1)
return filter
},
filterValue() {
if (!this.filterBy) return ''
if (!this.filterBy.includes('.')) return ''
return this.$decode(this.filterBy.split('.')[1])
},
currentLibraryId() { currentLibraryId() {
return this.$store.state.libraries.currentLibraryId return this.$store.state.libraries.currentLibraryId
}, },
@ -149,6 +171,7 @@ export default {
return 6 return 6
}, },
shelfHeight() { shelfHeight() {
if (this.isAlternativeBookshelfView) return this.entityHeight + 80 * this.sizeMultiplier
return this.entityHeight + 40 return this.entityHeight + 40
}, },
totalEntityCardWidth() { totalEntityCardWidth() {
@ -157,12 +180,19 @@ export default {
}, },
selectedAudiobooks() { selectedAudiobooks() {
return this.$store.state.selectedAudiobooks || [] return this.$store.state.selectedAudiobooks || []
},
sizeMultiplier() {
var baseSize = this.isCoverSquareAspectRatio ? 192 : 120
return this.entityWidth / baseSize
} }
}, },
methods: { methods: {
showBookshelfTextureModal() { showBookshelfTextureModal() {
this.$store.commit('globals/setShowBookshelfTextureModal', true) this.$store.commit('globals/setShowBookshelfTextureModal', true)
}, },
clearFilter() {
this.$store.dispatch('user/updateUserSettings', { filterBy: 'all' })
},
editEntity(entity) { editEntity(entity) {
if (this.entityName === 'books' || this.entityName === 'series-books') { if (this.entityName === 'books' || this.entityName === 'series-books') {
var bookIds = this.entities.map((e) => e.id) var bookIds = this.entities.map((e) => e.id)

View File

@ -145,7 +145,7 @@ export default {
audioPlayerMounted() { audioPlayerMounted() {
this.audioPlayerReady = true this.audioPlayerReady = true
if (this.stream) { if (this.stream) {
console.log('[STREAM-CONTAINER] audioPlayerMounted w/ Stream', this.stream) console.log('[STREAM-CONTAINER] audioPlayer Mounted w/ Stream', this.stream)
this.openStream() this.openStream()
} }
}, },

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="flex h-full px-1 overflow-hidden"> <div class="flex items-center h-full px-1 overflow-hidden">
<covers-book-cover :audiobook="audiobook" :width="coverWidth" :book-cover-aspect-ratio="bookCoverAspectRatio" /> <covers-book-cover :audiobook="audiobook" :width="coverWidth" :book-cover-aspect-ratio="bookCoverAspectRatio" />
<div class="flex-grow px-2 audiobookSearchCardContent"> <div class="flex-grow px-2 audiobookSearchCardContent">
<p v-if="matchKey !== 'title'" class="truncate text-sm">{{ title }}</p> <p v-if="matchKey !== 'title'" class="truncate text-sm">{{ title }}</p>
@ -10,7 +10,7 @@
<p v-if="matchKey !== 'authorFL'" class="text-xs text-gray-200 truncate">by {{ authorFL }}</p> <p v-if="matchKey !== 'authorFL'" class="text-xs text-gray-200 truncate">by {{ authorFL }}</p>
<p v-else class="truncate text-xs text-gray-200" v-html="matchHtml" /> <p v-else class="truncate text-xs text-gray-200" v-html="matchHtml" />
<div v-if="matchKey === 'series' || matchKey === 'tags'" class="m-0 p-0 truncate" v-html="matchHtml" /> <div v-if="matchKey === 'series' || matchKey === 'tags' || matchKey === 'isbn' || matchKey === 'asin'" class="m-0 p-0 truncate text-xs" v-html="matchHtml" />
</div> </div>
</div> </div>
</template> </template>
@ -70,6 +70,8 @@ export default {
if (this.matchKey === 'tags') return `<p class="truncate">Tags: ${html}</p>` if (this.matchKey === 'tags') return `<p class="truncate">Tags: ${html}</p>`
if (this.matchKey === 'authorFL') return `by ${html}` if (this.matchKey === 'authorFL') return `by ${html}`
if (this.matchKey === 'isbn') return `<p class="truncate">ISBN: ${html}</p>`
if (this.matchKey === 'asin') return `<p class="truncate">ASIN: ${html}</p>`
if (this.matchKey === 'series') return `<p class="truncate">Series: ${html}</p>` if (this.matchKey === 'series') return `<p class="truncate">Series: ${html}</p>`
return `${html}` return `${html}`
} }

View File

@ -5,6 +5,13 @@
<div class="absolute cover-bg" ref="coverBg" /> <div class="absolute cover-bg" ref="coverBg" />
</div> </div>
<div v-if="isAlternativeBookshelfView" class="absolute left-0 z-50 w-full" :style="{ bottom: `-${sizeMultiplier * 3}rem` }">
<p class="truncate" :style="{ fontSize: 0.9 * sizeMultiplier + 'rem' }">
<span v-if="volumeNumber">#{{ volumeNumber }}&nbsp;</span>{{ title }}
</p>
<p class="truncate text-gray-400" :style="{ fontSize: 0.8 * sizeMultiplier + 'rem' }">{{ authorFL }}</p>
</div>
<div class="w-full h-full absolute top-0 left-0 rounded overflow-hidden z-10"> <div class="w-full h-full absolute top-0 left-0 rounded overflow-hidden z-10">
<div v-show="audiobook && !imageReady" class="absolute top-0 left-0 w-full h-full flex items-center justify-center" :style="{ padding: sizeMultiplier * 0.5 + 'rem' }"> <div v-show="audiobook && !imageReady" class="absolute top-0 left-0 w-full h-full flex items-center justify-center" :style="{ padding: sizeMultiplier * 0.5 + 'rem' }">
<p :style="{ fontSize: sizeMultiplier * 0.8 + 'rem' }" class="font-book text-gray-300 text-center">{{ title }}</p> <p :style="{ fontSize: sizeMultiplier * 0.8 + 'rem' }" class="font-book text-gray-300 text-center">{{ title }}</p>
@ -79,6 +86,7 @@ export default {
}, },
bookCoverAspectRatio: Number, bookCoverAspectRatio: Number,
showVolumeNumber: Boolean, showVolumeNumber: Boolean,
bookshelfView: Number,
bookMount: { bookMount: {
// Book can be passed as prop or set with setEntity() // Book can be passed as prop or set with setEntity()
type: Object, type: Object,
@ -292,6 +300,10 @@ export default {
return this.authorFL.slice(0, 27) + '...' return this.authorFL.slice(0, 27) + '...'
} }
return this.authorFL return this.authorFL
},
isAlternativeBookshelfView() {
var constants = this.$constants || this.$nuxt.$constants
return this.bookshelfView === constants.BookshelfView.TITLES
} }
}, },
methods: { methods: {

View File

@ -74,7 +74,6 @@ export default {
}, },
methods: { methods: {
setEntity(_series) { setEntity(_series) {
console.log('setting entity', _series)
this.series = _series this.series = _series
}, },
setSelectionMode(val) { setSelectionMode(val) {

View File

@ -14,7 +14,7 @@
</div> </div>
</button> </button>
<div v-show="showMenu" class="absolute z-10 mt-1 w-full bg-bg border border-black-200 shadow-lg max-h-80 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm"> <div v-show="showMenu" class="absolute z-10 mt-1 w-full bg-bg border border-black-200 shadow-lg max-h-96 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm">
<ul v-show="!sublist" class="h-full w-full" role="listbox" aria-labelledby="listbox-label"> <ul v-show="!sublist" class="h-full w-full" role="listbox" aria-labelledby="listbox-label">
<template v-for="item in items"> <template v-for="item in items">
<li :key="item.value" class="text-gray-50 select-none relative py-2 pr-9 cursor-pointer hover:bg-black-400" :class="item.value === selected ? 'bg-primary bg-opacity-50' : ''" role="option" @click="clickedOption(item)"> <li :key="item.value" class="text-gray-50 select-none relative py-2 pr-9 cursor-pointer hover:bg-black-400" :class="item.value === selected ? 'bg-primary bg-opacity-50' : ''" role="option" @click="clickedOption(item)">
@ -97,6 +97,11 @@ export default {
value: 'narrators', value: 'narrators',
sublist: true sublist: true
}, },
{
text: 'Language',
value: 'languages',
sublist: true
},
{ {
text: 'Progress', text: 'Progress',
value: 'progress', value: 'progress',
@ -155,6 +160,9 @@ export default {
narrators() { narrators() {
return this.filterData.narrators || [] return this.filterData.narrators || []
}, },
languages() {
return this.filterData.languages || []
},
progress() { progress() {
return ['Read', 'Unread', 'In Progress'] return ['Read', 'Unread', 'In Progress']
}, },

View File

@ -102,6 +102,9 @@ export default {
}, },
selectedBookIds() { selectedBookIds() {
return this.$store.state.selectedAudiobooks || [] return this.$store.state.selectedAudiobooks || []
},
currentLibraryId() {
return this.$store.state.libraries.currentLibraryId
} }
}, },
methods: { methods: {
@ -186,9 +189,10 @@ export default {
var books = this.showBatchUserCollectionModal ? this.selectedBookIds : [this.selectedAudiobookId] var books = this.showBatchUserCollectionModal ? this.selectedBookIds : [this.selectedAudiobookId]
var newCollection = { var newCollection = {
books: books, books: books,
libraryId: this.selectedAudiobook.libraryId, libraryId: this.currentLibraryId,
name: this.newCollectionName name: this.newCollectionName
} }
this.$axios this.$axios
.$post('/api/collections', newCollection) .$post('/api/collections', newCollection)
.then((data) => { .then((data) => {

View File

@ -2,9 +2,14 @@
<div class="w-full h-full relative"> <div class="w-full h-full relative">
<form class="w-full h-full" @submit.prevent="submitForm"> <form class="w-full h-full" @submit.prevent="submitForm">
<div ref="formWrapper" class="px-4 py-6 details-form-wrapper w-full overflow-hidden overflow-y-auto"> <div ref="formWrapper" class="px-4 py-6 details-form-wrapper w-full overflow-hidden overflow-y-auto">
<ui-text-input-with-label v-model="details.title" label="Title" /> <div class="flex -mx-1">
<div class="w-1/2 px-1">
<ui-text-input-with-label v-model="details.subtitle" label="Subtitle" class="mt-2" /> <ui-text-input-with-label v-model="details.title" label="Title" />
</div>
<div class="flex-grow px-1">
<ui-text-input-with-label v-model="details.subtitle" label="Subtitle" />
</div>
</div>
<div class="flex mt-2 -mx-1"> <div class="flex mt-2 -mx-1">
<div class="w-3/4 px-1"> <div class="w-3/4 px-1">
@ -43,8 +48,17 @@
<ui-text-input-with-label v-model="details.publisher" label="Publisher" /> <ui-text-input-with-label v-model="details.publisher" label="Publisher" />
</div> </div>
<div class="flex-grow px-1"> <div class="flex-grow px-1">
<ui-text-input-with-label v-model="details.language" label="Language" />
</div>
</div>
<div class="flex mt-2 -mx-1">
<div class="w-1/3 px-1">
<ui-text-input-with-label v-model="details.isbn" label="ISBN" /> <ui-text-input-with-label v-model="details.isbn" label="ISBN" />
</div> </div>
<div class="w-1/3 px-1">
<ui-text-input-with-label v-model="details.asin" label="ASIN" />
</div>
</div> </div>
</div> </div>
@ -90,7 +104,9 @@ export default {
volumeNumber: null, volumeNumber: null,
publishYear: null, publishYear: null,
publisher: null, publisher: null,
language: null,
isbn: null, isbn: null,
asin: null,
genres: [] genres: []
}, },
newTags: [], newTags: [],
@ -231,7 +247,9 @@ export default {
this.details.volumeNumber = this.book.volumeNumber this.details.volumeNumber = this.book.volumeNumber
this.details.publishYear = this.book.publishYear this.details.publishYear = this.book.publishYear
this.details.publisher = this.book.publisher || null this.details.publisher = this.book.publisher || null
this.details.language = this.book.language || null
this.details.isbn = this.book.isbn || null this.details.isbn = this.book.isbn || null
this.details.asin = this.book.asin || null
this.newTags = this.audiobook.tags || [] this.newTags = this.audiobook.tags || []
}, },

View File

@ -65,10 +65,7 @@
<ui-checkbox v-model="selectedMatchUsage.publishYear" /> <ui-checkbox v-model="selectedMatchUsage.publishYear" />
<ui-text-input-with-label v-model="selectedMatch.publishYear" :disabled="!selectedMatchUsage.publishYear" label="Publish Year" class="flex-grow ml-4" /> <ui-text-input-with-label v-model="selectedMatch.publishYear" :disabled="!selectedMatchUsage.publishYear" label="Publish Year" class="flex-grow ml-4" />
</div> </div>
<div v-if="selectedMatch.isbn" class="flex items-center py-2">
<ui-checkbox v-model="selectedMatchUsage.isbn" />
<ui-text-input-with-label v-model="selectedMatch.isbn" :disabled="!selectedMatchUsage.isbn" label="ISBN" class="flex-grow ml-4" />
</div>
<div v-if="selectedMatch.series" class="flex items-center py-2"> <div v-if="selectedMatch.series" class="flex items-center py-2">
<ui-checkbox v-model="selectedMatchUsage.series" /> <ui-checkbox v-model="selectedMatchUsage.series" />
<ui-text-input-with-label v-model="selectedMatch.series" :disabled="!selectedMatchUsage.series" label="Series" class="flex-grow ml-4" /> <ui-text-input-with-label v-model="selectedMatch.series" :disabled="!selectedMatchUsage.series" label="Series" class="flex-grow ml-4" />
@ -77,10 +74,14 @@
<ui-checkbox v-model="selectedMatchUsage.volumeNumber" /> <ui-checkbox v-model="selectedMatchUsage.volumeNumber" />
<ui-text-input-with-label v-model="selectedMatch.volumeNumber" :disabled="!selectedMatchUsage.volumeNumber" label="Volume Number" class="flex-grow ml-4" /> <ui-text-input-with-label v-model="selectedMatch.volumeNumber" :disabled="!selectedMatchUsage.volumeNumber" label="Volume Number" class="flex-grow ml-4" />
</div> </div>
<!-- <div v-if="selectedMatch.asin" class="flex items-center py-2"> <div v-if="selectedMatch.isbn" class="flex items-center py-2">
<ui-checkbox v-model="selectedMatchUsage.isbn" />
<ui-text-input-with-label v-model="selectedMatch.isbn" :disabled="!selectedMatchUsage.isbn" label="ISBN" class="flex-grow ml-4" />
</div>
<div v-if="selectedMatch.asin" class="flex items-center py-2">
<ui-checkbox v-model="selectedMatchUsage.asin" /> <ui-checkbox v-model="selectedMatchUsage.asin" />
<ui-text-input-with-label v-model="selectedMatch.asin" :disabled="!selectedMatchUsage.asin" label="ASIN" class="flex-grow ml-4" /> <ui-text-input-with-label v-model="selectedMatch.asin" :disabled="!selectedMatchUsage.asin" label="ASIN" class="flex-grow ml-4" />
</div> --> </div>
<div class="flex items-center justify-end py-2"> <div class="flex items-center justify-end py-2">
<ui-btn color="success" type="submit">Update</ui-btn> <ui-btn color="success" type="submit">Update</ui-btn>
</div> </div>
@ -104,20 +105,6 @@ export default {
searchTitle: null, searchTitle: null,
searchAuthor: null, searchAuthor: null,
lastSearch: null, lastSearch: null,
providers: [
{
text: 'Google Books',
value: 'google'
},
{
text: 'Open Library',
value: 'openlibrary'
},
{
text: 'Audible',
value: 'audible'
}
],
provider: 'google', provider: 'google',
searchResults: [], searchResults: [],
hasSearched: false, hasSearched: false,
@ -129,11 +116,12 @@ export default {
author: true, author: true,
narrator: true, narrator: true,
description: true, description: true,
isbn: true,
publisher: true, publisher: true,
publishYear: true, publishYear: true,
series: true, series: true,
volumeNumber: true volumeNumber: true,
asin: true,
isbn: true
} }
} }
}, },
@ -156,6 +144,9 @@ export default {
}, },
bookCoverAspectRatio() { bookCoverAspectRatio() {
return this.$store.getters['getBookCoverAspectRatio'] return this.$store.getters['getBookCoverAspectRatio']
},
providers() {
return this.$store.state.scanners.providers
} }
}, },
methods: { methods: {
@ -205,11 +196,12 @@ export default {
author: true, author: true,
narrator: true, narrator: true,
description: true, description: true,
isbn: true,
publisher: true, publisher: true,
publishYear: true, publishYear: true,
series: true, series: true,
volumeNumber: true volumeNumber: true,
asin: true,
isbn: true
} }
if (this.audiobook.id !== this.audiobookId) { if (this.audiobook.id !== this.audiobookId) {

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="w-96 my-6 mx-auto"> <div class="w-96 my-6 mx-auto">
<h1 class="text-2xl mb-4 font-book">Minutes Listening</h1> <h1 class="text-2xl mb-4 font-book">Minutes Listening <span class="text-white text-opacity-60 text-lg">(Last 7 days)</span></h1>
<div class="relative w-96 h-72"> <div class="relative w-96 h-72">
<div class="absolute top-0 left-0"> <div class="absolute top-0 left-0">
<template v-for="lbl in yAxisLabels"> <template v-for="lbl in yAxisLabels">

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="flex flex-wrap justify-between mt-6"> <div class="flex flex-wrap justify-center mt-6">
<div class="flex p-2"> <div class="flex px-2">
<svg class="h-14 w-14 md:h-18 md:w-18" viewBox="0 0 24 24"> <svg class="h-14 w-14 md:h-18 md:w-18" viewBox="0 0 24 24">
<path fill="currentColor" d="M9 3V18H12V3H9M12 5L16 18L19 17L15 4L12 5M5 5V18H8V5H5M3 19V21H21V19H3Z" /> <path fill="currentColor" d="M9 3V18H12V3H9M12 5L16 18L19 17L15 4L12 5M5 5V18H8V5H5M3 19V21H21V19H3Z" />
</svg> </svg>
@ -9,20 +9,8 @@
<p class="font-book text-xs md:text-sm text-white text-opacity-80">Books in Library</p> <p class="font-book text-xs md:text-sm text-white text-opacity-80">Books in Library</p>
</div> </div>
</div> </div>
<div class="flex p-2">
<svg class="h-14 w-14 md:h-18 md:w-18" viewBox="0 0 24 24">
<path
fill="currentColor"
d="M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z"
/>
</svg>
<div class="px-3">
<p class="text-4xl md:text-5xl font-bold">{{ userAudiobooksRead.length }}</p>
<p class="font-book text-xs md:text-sm text-white text-opacity-80">Books Read</p>
</div>
</div>
<div class="flex p-2"> <div class="flex px-4">
<span class="material-icons text-7xl">show_chart</span> <span class="material-icons text-7xl">show_chart</span>
<div class="px-1"> <div class="px-1">
<p class="text-4xl md:text-5xl font-bold">{{ totalAudiobookHours }}</p> <p class="text-4xl md:text-5xl font-bold">{{ totalAudiobookHours }}</p>
@ -30,7 +18,7 @@
</div> </div>
</div> </div>
<div class="flex p-2"> <div class="flex px-4">
<svg class="h-14 w-14 md:h-18 md:w-18" viewBox="0 0 24 24"> <svg class="h-14 w-14 md:h-18 md:w-18" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M12,13C14.67,13 20,14.33 20,17V20H4V17C4,14.33 9.33,13 12,13M12,14.9C9.03,14.9 5.9,16.36 5.9,17V18.1H18.1V17C18.1,16.36 14.97,14.9 12,14.9Z" /> <path fill="currentColor" d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M12,13C14.67,13 20,14.33 20,17V20H4V17C4,14.33 9.33,13 12,13M12,14.9C9.03,14.9 5.9,16.36 5.9,17V18.1H18.1V17C18.1,16.36 14.97,14.9 12,14.9Z" />
</svg> </svg>
@ -40,11 +28,19 @@
</div> </div>
</div> </div>
<div class="flex p-2"> <div class="flex px-4">
<span class="material-icons-outlined" style="font-size: 4.1rem">watch_later</span> <span class="material-icons-outlined text-6xl pt-1">insert_drive_file</span>
<div class="px-1"> <div class="px-1">
<p class="text-4xl md:text-5xl font-bold">{{ totalMinutesListening }}</p> <p class="text-4xl md:text-5xl font-bold">{{ totalSizeNum }}</p>
<p class="font-book text-xs md:text-sm text-white text-opacity-80">Minutes Listening</p> <p class="font-book text-xs md:text-sm text-white text-opacity-80">Size ({{ totalSizeMod }})</p>
</div>
</div>
<div class="flex px-4">
<span class="material-icons-outlined text-6xl pt-1">audio_file</span>
<div class="px-1">
<p class="text-4xl md:text-5xl font-bold">{{ numAudioTracks }}</p>
<p class="font-book text-xs md:text-sm text-white text-opacity-80">Audio Tracks</p>
</div> </div>
</div> </div>
</div> </div>
@ -53,10 +49,6 @@
<script> <script>
export default { export default {
props: { props: {
listeningStats: {
type: Object,
default: () => {}
},
libraryStats: { libraryStats: {
type: Object, type: Object,
default: () => {} default: () => {}
@ -75,11 +67,8 @@ export default {
totalAuthors() { totalAuthors() {
return this.libraryStats ? this.libraryStats.totalAuthors : 0 return this.libraryStats ? this.libraryStats.totalAuthors : 0
}, },
userAudiobooks() { numAudioTracks() {
return Object.values(this.user.audiobooks || {}) return this.libraryStats ? this.libraryStats.numAudioTracks : 0
},
userAudiobooksRead() {
return this.userAudiobooks.filter((ab) => !!ab.isRead)
}, },
totalAudiobookDuration() { totalAudiobookDuration() {
return this.libraryStats ? this.libraryStats.totalDuration : 0 return this.libraryStats ? this.libraryStats.totalDuration : 0
@ -88,9 +77,15 @@ export default {
var totalHours = Math.round(this.totalAudiobookDuration / (60 * 60)) var totalHours = Math.round(this.totalAudiobookDuration / (60 * 60))
return totalHours return totalHours
}, },
totalMinutesListening() { totalSizePretty() {
if (!this.listeningStats) return 0 var totalSize = this.libraryStats ? this.libraryStats.totalSize : 0
return Math.round(this.listeningStats.totalTime / 60) return this.$bytesPretty(totalSize, 1)
},
totalSizeNum() {
return this.totalSizePretty.split(' ')[0]
},
totalSizeMod() {
return this.totalSizePretty.split(' ')[1]
} }
}, },
methods: {}, methods: {},

View File

@ -9,7 +9,7 @@
<draggable :list="libraryCopies" v-bind="dragOptions" class="list-group" draggable=".item" tag="div" @start="startDrag" @end="endDrag"> <draggable :list="libraryCopies" v-bind="dragOptions" class="list-group" draggable=".item" tag="div" @start="startDrag" @end="endDrag">
<template v-for="library in libraryCopies"> <template v-for="library in libraryCopies">
<div :key="library.id" class="item"> <div :key="library.id" class="item">
<modals-libraries-library-item :library="library" :selected="currentLibraryId === library.id" :show-edit="true" :dragging="drag" @edit="editLibrary" @sort="draggableSort" @click="setLibrary" /> <modals-libraries-library-item :library="library" :selected="currentLibraryId === library.id" :show-edit="true" :dragging="drag" @edit="editLibrary" @click="setLibrary" />
</div> </div>
</template> </template>
</draggable> </draggable>

View File

@ -21,7 +21,7 @@
<td> <td>
<div class="flex items-center"> <div class="flex items-center">
<widgets-online-indicator :value="!!usersOnline[user.id]" /> <widgets-online-indicator :value="!!usersOnline[user.id]" />
<span class="pl-2">{{ user.username }}</span> <span v-show="$isDev" class="text-xs text-gray-400 italic pl-4">({{ user.id }})</span> <p class="pl-2 truncate">{{ user.username }}</p>
</div> </div>
</td> </td>
<td class="text-sm">{{ user.type }}</td> <td class="text-sm">{{ user.type }}</td>

View File

@ -85,12 +85,24 @@ export default {
reconnectFailed() { reconnectFailed() {
console.error('[SOCKET] reconnect failed') console.error('[SOCKET] reconnect failed')
}, },
init(payload) { init(payload, count = 0) {
if (!this.$refs.streamContainer) {
if (count > 20) {
console.error('Stream container never mounted')
return
}
setTimeout(() => {
this.init(payload, ++count)
}, 100)
return
}
console.log('Init Payload', payload) console.log('Init Payload', payload)
if (payload.stream) { if (payload.stream) {
if (this.$refs.streamContainer) { if (this.$refs.streamContainer) {
this.$store.commit('setStream', payload.stream) this.$store.commit('setStream', payload.stream)
this.$refs.streamContainer.streamOpen(payload.stream) this.$refs.streamContainer.streamOpen(payload.stream)
} else {
console.warn('Stream Container not mounted')
} }
} }
if (payload.user) { if (payload.user) {

View File

@ -51,7 +51,8 @@ export default {
index, index,
width: this.entityWidth, width: this.entityWidth,
height: this.entityHeight, height: this.entityHeight,
bookCoverAspectRatio: this.bookCoverAspectRatio bookCoverAspectRatio: this.bookCoverAspectRatio,
bookshelfView: this.bookshelfView
} }
if (this.entityName === 'series-books') props.showVolumeNumber = true if (this.entityName === 'series-books') props.showVolumeNumber = true

View File

@ -1,6 +1,6 @@
{ {
"name": "audiobookshelf-client", "name": "audiobookshelf-client",
"version": "1.6.48", "version": "1.6.59",
"description": "Audiobook manager and player", "description": "Audiobook manager and player",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -22,7 +22,8 @@
<span class="text-white">Track From Metadata</span> <span class="text-white">Track From Metadata</span>
<span class="material-icons ml-1" :class="currentSort === 'metadata' ? 'text-white text-opacity-100 text-lg' : 'text-sm'">{{ currentSort === 'metadata' ? 'expand_more' : 'unfold_more' }}</span> <span class="material-icons ml-1" :class="currentSort === 'metadata' ? 'text-white text-opacity-100 text-lg' : 'text-sm'">{{ currentSort === 'metadata' ? 'expand_more' : 'unfold_more' }}</span>
</div> </div>
<div class="font-mono w-20 text-center">CD From Filename</div> <div class="font-mono w-20 text-center">Disc From Filename</div>
<div class="font-mono w-20 text-center">Disc From Metadata</div>
<div class="font-book text-center px-4 flex-grow flex items-center cursor-pointer text-white text-opacity-40 hover:text-opacity-100" @click="sortByFilename" @mousedown.prevent> <div class="font-book text-center px-4 flex-grow flex items-center cursor-pointer text-white text-opacity-40 hover:text-opacity-100" @click="sortByFilename" @mousedown.prevent>
<span class="text-white">Filename</span> <span class="text-white">Filename</span>
<span class="material-icons ml-1" :class="currentSort === 'filename' ? 'text-white text-opacity-100 text-lg' : 'text-sm'">{{ currentSort === 'filename' ? 'expand_more' : 'unfold_more' }}</span> <span class="material-icons ml-1" :class="currentSort === 'filename' ? 'text-white text-opacity-100 text-lg' : 'text-sm'">{{ currentSort === 'filename' ? 'expand_more' : 'unfold_more' }}</span>
@ -49,7 +50,10 @@
{{ audio.trackNumFromMeta }} {{ audio.trackNumFromMeta }}
</div> </div>
<div class="font-book truncate px-4 w-20"> <div class="font-book truncate px-4 w-20">
{{ audio.cdNumFromFilename }} {{ audio.discNumFromFilename }}
</div>
<div class="font-book truncate px-4 w-20">
{{ audio.discNumFromMeta }}
</div> </div>
<div class="font-book truncate px-4 flex-grow"> <div class="font-book truncate px-4 flex-grow">
{{ audio.filename }} {{ audio.filename }}

View File

@ -5,7 +5,7 @@
<div class="w-full flex justify-center md:block sm:w-32 md:w-52" style="min-width: 208px"> <div class="w-full flex justify-center md:block sm:w-32 md:w-52" style="min-width: 208px">
<div class="relative" style="height: fit-content"> <div class="relative" style="height: fit-content">
<covers-book-cover :audiobook="audiobook" :width="bookCoverWidth" :book-cover-aspect-ratio="bookCoverAspectRatio" /> <covers-book-cover :audiobook="audiobook" :width="bookCoverWidth" :book-cover-aspect-ratio="bookCoverAspectRatio" />
<div class="absolute bottom-0 left-0 h-1.5 bg-yellow-400 shadow-sm" :class="userIsRead ? 'bg-success' : 'bg-yellow-400'" :style="{ width: 208 * progressPercent + 'px' }"></div> <div class="absolute bottom-0 left-0 h-1.5 bg-yellow-400 shadow-sm z-10" :class="userIsRead ? 'bg-success' : 'bg-yellow-400'" :style="{ width: 208 * progressPercent + 'px' }"></div>
</div> </div>
</div> </div>
<div class="flex-grow px-2 py-6 md:py-0 md:px-10"> <div class="flex-grow px-2 py-6 md:py-0 md:px-10">
@ -125,7 +125,7 @@
</div> </div>
<div class="my-4 max-w-2xl"> <div class="my-4 max-w-2xl">
<p class="text-base text-gray-100">{{ description }}</p> <p class="text-base text-gray-100 whitespace-pre-line">{{ description }}</p>
</div> </div>
<div v-if="missingParts.length" class="bg-error border-red-800 shadow-md p-4"> <div v-if="missingParts.length" class="bg-error border-red-800 shadow-md p-4">

View File

@ -67,10 +67,30 @@
</div> </div>
</div> </div>
<div class="flex mt-2 -mx-1"> <!-- <div class="flex mt-2 -mx-1">
<div class="w-1/2 px-1"> <div class="w-1/2 px-1">
<ui-text-input-with-label v-model="audiobook.book.narrator" label="Narrator" /> <ui-text-input-with-label v-model="audiobook.book.narrator" label="Narrator" />
</div> </div>
</div> -->
<div class="flex mt-2 -mx-1">
<div class="w-1/3 px-1">
<ui-text-input-with-label v-model="audiobook.book.narrator" label="Narrator" />
</div>
<div class="w-1/3 px-1">
<ui-text-input-with-label v-model="audiobook.book.publisher" label="Publisher" />
</div>
<div class="flex-grow px-1">
<ui-text-input-with-label v-model="audiobook.book.language" label="Language" />
</div>
</div>
<div class="flex mt-2 -mx-1">
<div class="w-1/3 px-1">
<ui-text-input-with-label v-model="audiobook.book.isbn" label="ISBN" />
</div>
<div class="w-1/3 px-1">
<ui-text-input-with-label v-model="audiobook.book.asin" label="ASIN" />
</div>
</div> </div>
</div> </div>
</div> </div>
@ -223,7 +243,7 @@ export default {
return arr1.join(',') !== arr2.join(',') return arr1.join(',') !== arr2.join(',')
}, },
compareAudiobooks(newAb, origAb) { compareAudiobooks(newAb, origAb) {
const bookKeysToCheck = ['title', 'subtitle', 'narrator', 'author', 'publishYear', 'series', 'volumeNumber', 'description'] const bookKeysToCheck = ['title', 'subtitle', 'narrator', 'author', 'publishYear', 'series', 'volumeNumber', 'description', 'language', 'publisher', 'isbn', 'asin']
var newBook = newAb.book var newBook = newAb.book
var origBook = origAb.book var origBook = origAb.book
var diffObj = {} var diffObj = {}

View File

@ -14,9 +14,12 @@
<script> <script>
export default { export default {
asyncData({ store, redirect }) { asyncData({ store, redirect, route }) {
if (!store.getters['user/getIsRoot']) { if (!store.getters['user/getIsRoot']) {
redirect('/?error=unauthorized') // Non-Root user only has access to the listening stats page
if (route.name !== 'config-stats') {
redirect('/config/stats')
}
} }
}, },
data() { data() {
@ -38,7 +41,7 @@ export default {
currentPage() { currentPage() {
if (!this.$route.name) return 'Settings' if (!this.$route.name) return 'Settings'
var routeName = this.$route.name.split('-') var routeName = this.$route.name.split('-')
if (routeName.length > 0) return routeName[1] if (routeName.length > 0) return routeName.slice(1).join('-')
return 'Settings' return 'Settings'
} }
}, },
@ -72,7 +75,7 @@ export default {
width: 900px; width: 900px;
max-width: calc(100% - 176px); max-width: calc(100% - 176px);
} }
.configContent.page-stats { .configContent.page-library-stats {
width: 1200px; width: 1200px;
} }
@media (max-width: 1024px) { @media (max-width: 1024px) {

View File

@ -7,6 +7,31 @@
<h1 class="text-xl">Settings</h1> <h1 class="text-xl">Settings</h1>
</div> </div>
<div class="flex items-center py-2">
<ui-toggle-switch v-model="storeCoversInAudiobookDir" :disabled="updatingServerSettings" @input="updateCoverStorageDestination" />
<ui-tooltip :text="coverDestinationTooltip">
<p class="pl-4 text-lg">Store covers with audiobook <span class="material-icons icon-text">info_outlined</span></p>
</ui-tooltip>
</div>
<div class="flex items-center py-2">
<ui-toggle-switch v-model="useSquareBookCovers" :disabled="updatingServerSettings" @input="updateBookCoverAspectRatio" />
<ui-tooltip :text="coverAspectRatioTooltip">
<p class="pl-4 text-lg">Use square book covers <span class="material-icons icon-text">info_outlined</span></p>
</ui-tooltip>
</div>
<div class="flex items-center py-2">
<ui-toggle-switch v-model="useAlternativeBookshelfView" :disabled="updatingServerSettings" @input="updateAlternativeBookshelfView" />
<ui-tooltip :text="bookshelfViewTooltip">
<p class="pl-4 text-lg">Use alternative library bookshelf view <span class="material-icons icon-text">info_outlined</span></p>
</ui-tooltip>
</div>
<div class="flex items-center mb-2 mt-8">
<h1 class="text-xl">Scanner Settings</h1>
</div>
<div class="flex items-center py-2"> <div class="flex items-center py-2">
<ui-toggle-switch v-model="newServerSettings.scannerParseSubtitle" small :disabled="updatingServerSettings" @input="updateScannerParseSubtitle" /> <ui-toggle-switch v-model="newServerSettings.scannerParseSubtitle" small :disabled="updatingServerSettings" @input="updateScannerParseSubtitle" />
<ui-tooltip :text="parseSubtitleTooltip"> <ui-tooltip :text="parseSubtitleTooltip">
@ -19,6 +44,10 @@
<ui-tooltip :text="scannerFindCoversTooltip"> <ui-tooltip :text="scannerFindCoversTooltip">
<p class="pl-4 text-lg">Scanner find covers <span class="material-icons icon-text">info_outlined</span></p> <p class="pl-4 text-lg">Scanner find covers <span class="material-icons icon-text">info_outlined</span></p>
</ui-tooltip> </ui-tooltip>
<div class="flex-grow" />
</div>
<div v-if="newServerSettings.scannerFindCovers" class="w-44 ml-14 mb-2">
<ui-dropdown v-model="newServerSettings.scannerCoverProvider" small :items="providers" label="Cover Provider" @input="updateScannerCoverProvider" :disabled="updatingServerSettings" />
</div> </div>
<div class="flex items-center py-2"> <div class="flex items-center py-2">
@ -34,20 +63,6 @@
<p class="pl-4 text-lg">Scanner prefer OPF metadata <span class="material-icons icon-text">info_outlined</span></p> <p class="pl-4 text-lg">Scanner prefer OPF metadata <span class="material-icons icon-text">info_outlined</span></p>
</ui-tooltip> </ui-tooltip>
</div> </div>
<div class="flex items-center py-2">
<ui-toggle-switch v-model="storeCoversInAudiobookDir" :disabled="updatingServerSettings" @input="updateCoverStorageDestination" />
<ui-tooltip :text="coverDestinationTooltip">
<p class="pl-4 text-lg">Store covers with audiobook <span class="material-icons icon-text">info_outlined</span></p>
</ui-tooltip>
</div>
<div class="flex items-center py-2">
<ui-toggle-switch v-model="useSquareBookCovers" :disabled="updatingServerSettings" @input="updateBookCoverAspectRatio" />
<ui-tooltip :text="coverAspectRatioTooltip">
<p class="pl-4 text-lg">Use square book covers <span class="material-icons icon-text">info_outlined</span></p>
</ui-tooltip>
</div>
</div> </div>
<div class="h-0.5 bg-primary bg-opacity-30 w-full" /> <div class="h-0.5 bg-primary bg-opacity-30 w-full" />
@ -78,9 +93,9 @@
</ui-tooltip> </ui-tooltip>
</div> </div>
</div> </div>
<div class="hidden md:block"> <!-- <div class="hidden md:block">
<a href="https://github.com/advplyr/audiobookshelf/discussions/75#discussion-3604812" target="_blank" class="text-blue-500 hover:text-blue-300 underline">Join the discussion</a> <a href="https://github.com/advplyr/audiobookshelf/discussions/75#discussion-3604812" target="_blank" class="text-blue-500 hover:text-blue-300 underline">Join the discussion</a>
</div> </div> -->
</div> </div>
</div> </div>
</div> </div>
@ -94,6 +109,7 @@ export default {
storeCoversInAudiobookDir: false, storeCoversInAudiobookDir: false,
updatingServerSettings: false, updatingServerSettings: false,
useSquareBookCovers: false, useSquareBookCovers: false,
useAlternativeBookshelfView: false,
isPurgingCache: false, isPurgingCache: false,
newServerSettings: {} newServerSettings: {}
} }
@ -134,6 +150,12 @@ export default {
coverAspectRatioTooltip() { coverAspectRatioTooltip() {
return 'Prefer to use square covers over standard 1.6:1 book covers' return 'Prefer to use square covers over standard 1.6:1 book covers'
}, },
bookshelfViewTooltip() {
return 'Alternative bookshelf view that shows title & author under book covers'
},
providers() {
return this.$store.state.scanners.providers
},
showExperimentalFeatures: { showExperimentalFeatures: {
get() { get() {
return this.$store.state.showExperimentalFeatures return this.$store.state.showExperimentalFeatures
@ -149,6 +171,11 @@ export default {
scannerFindCovers: !!val scannerFindCovers: !!val
}) })
}, },
updateScannerCoverProvider(val) {
this.updateServerSettings({
scannerCoverProvider: val
})
},
updateCoverStorageDestination(val) { updateCoverStorageDestination(val) {
this.newServerSettings.coverDestination = val ? this.$constants.CoverDestination.AUDIOBOOK : this.$constants.CoverDestination.METADATA this.newServerSettings.coverDestination = val ? this.$constants.CoverDestination.AUDIOBOOK : this.$constants.CoverDestination.METADATA
this.updateServerSettings({ this.updateServerSettings({
@ -175,6 +202,11 @@ export default {
coverAspectRatio: val ? this.$constants.BookCoverAspectRatio.SQUARE : this.$constants.BookCoverAspectRatio.STANDARD coverAspectRatio: val ? this.$constants.BookCoverAspectRatio.SQUARE : this.$constants.BookCoverAspectRatio.STANDARD
}) })
}, },
updateAlternativeBookshelfView(val) {
this.updateServerSettings({
bookshelfView: val ? this.$constants.BookshelfView.TITLES : this.$constants.BookshelfView.STANDARD
})
},
updateServerSettings(payload) { updateServerSettings(payload) {
this.updatingServerSettings = true this.updatingServerSettings = true
this.$store this.$store
@ -194,6 +226,8 @@ export default {
this.storeCoversInAudiobookDir = this.newServerSettings.coverDestination === this.$constants.CoverDestination.AUDIOBOOK this.storeCoversInAudiobookDir = this.newServerSettings.coverDestination === this.$constants.CoverDestination.AUDIOBOOK
this.useSquareBookCovers = this.newServerSettings.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE this.useSquareBookCovers = this.newServerSettings.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE
this.useAlternativeBookshelfView = this.newServerSettings.bookshelfView === this.$constants.BookshelfView.TITLES
}, },
resetAudiobooks() { resetAudiobooks() {
if (confirm('WARNING! This action will remove all audiobooks from the database including any updates or matches you have made. This does not do anything to your actual files. Shall we continue?')) { if (confirm('WARNING! This action will remove all audiobooks from the database including any updates or matches you have made. This does not do anything to your actual files. Shall we continue?')) {

View File

@ -0,0 +1,127 @@
<template>
<div>
<p class="text-xl">Stats for library {{ currentLibraryName }}</p>
<stats-preview-icons :library-stats="libraryStats" />
<div class="flex md:flex-row flex-wrap justify-between flex-col mt-12">
<div class="w-80 my-6 mx-auto">
<h1 class="text-2xl mb-4 font-book">Top 5 Genres</h1>
<p v-if="!top5Genres.length">No Genres</p>
<template v-for="genre in top5Genres">
<div :key="genre.genre" class="w-full py-2">
<div class="flex items-end mb-1">
<p class="text-2xl font-bold">{{ Math.round((100 * genre.count) / totalBooks) }}&nbsp;%</p>
<div class="flex-grow" />
<p class="text-base font-book text-white text-opacity-70">{{ genre.genre }}</p>
</div>
<div class="w-full rounded-full h-3 bg-primary bg-opacity-50 overflow-hidden">
<div class="bg-yellow-400 h-full rounded-full" :style="{ width: Math.round((100 * genre.count) / totalBooks) + '%' }" />
</div>
</div>
</template>
</div>
<div class="w-80 my-6 mx-auto">
<h1 class="text-2xl mb-4 font-book">Top 10 Authors</h1>
<p v-if="!top10Authors.length">No Authors</p>
<template v-for="(author, index) in top10Authors">
<div :key="author.author" class="w-full py-2">
<div class="flex items-center mb-1">
<p class="text-sm font-book text-white text-opacity-70 w-36 pr-2 truncate">{{ index + 1 }}.&nbsp;&nbsp;&nbsp;&nbsp;{{ author.author }}</p>
<div class="flex-grow rounded-full h-2.5 bg-primary bg-opacity-0 overflow-hidden">
<div class="bg-yellow-400 h-full rounded-full" :style="{ width: Math.round((100 * author.count) / mostUsedAuthorCount) + '%' }" />
</div>
<div class="w-4 ml-3">
<p class="text-sm font-bold">{{ author.count }}</p>
</div>
</div>
</div>
</template>
</div>
<div class="w-80 my-6 mx-auto">
<h1 class="text-2xl mb-4 font-book">Longest Audiobooks (hrs)</h1>
<p v-if="!top10LongestAudiobooks.length">No Audiobooks</p>
<template v-for="(ab, index) in top10LongestAudiobooks">
<div :key="index" class="w-full py-2">
<div class="flex items-center mb-1">
<p class="text-sm font-book text-white text-opacity-70 w-44 pr-2 truncate">{{ index + 1 }}.&nbsp;&nbsp;&nbsp;&nbsp;{{ ab.title }}</p>
<div class="flex-grow rounded-full h-2.5 bg-primary bg-opacity-0 overflow-hidden">
<div class="bg-yellow-400 h-full rounded-full" :style="{ width: Math.round((100 * ab.duration) / longestAudiobookDuration) + '%' }" />
</div>
<div class="w-4 ml-3">
<p class="text-sm font-bold">{{ (ab.duration / 3600).toFixed(1) }}</p>
</div>
</div>
</div>
</template>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
libraryStats: null
}
},
watch: {
currentLibraryId(newVal, oldVal) {
if (newVal) {
this.init()
}
}
},
computed: {
user() {
return this.$store.state.user.user
},
totalBooks() {
return this.libraryStats ? this.libraryStats.totalBooks : 0
},
genresWithCount() {
return this.libraryStats ? this.libraryStats.genresWithCount : []
},
top5Genres() {
return this.genresWithCount.slice(0, 5)
},
top10LongestAudiobooks() {
return this.libraryStats ? this.libraryStats.longestAudiobooks || [] : []
},
longestAudiobookDuration() {
if (!this.top10LongestAudiobooks.length) return 0
return this.top10LongestAudiobooks[0].duration
},
authorsWithCount() {
return this.libraryStats ? this.libraryStats.authorsWithCount : []
},
mostUsedAuthorCount() {
if (!this.authorsWithCount.length) return 0
return this.authorsWithCount[0].count
},
top10Authors() {
return this.authorsWithCount.slice(0, 10)
},
currentLibraryId() {
return this.$store.state.libraries.currentLibraryId
},
currentLibraryName() {
return this.$store.getters['libraries/getCurrentLibraryName']
}
},
methods: {
async init() {
this.libraryStats = await this.$axios.$get(`/api/libraries/${this.currentLibraryId}/stats`).catch((err) => {
console.error('Failed to get library stats', err)
var errorMsg = err.response ? err.response.data || 'Unknown Error' : 'Unknown Error'
this.$toast.error(`Failed to get library stats: ${errorMsg}`)
})
console.log('lib stats', this.libraryStats)
}
},
mounted() {
this.init()
}
}
</script>

View File

@ -1,40 +1,56 @@
<template> <template>
<div> <div>
<stats-preview-icons :listening-stats="listeningStats" :library-stats="libraryStats" /> <div class="flex justify-center">
<div class="flex p-2">
<svg class="h-14 w-14 md:h-18 md:w-18" viewBox="0 0 24 24">
<path
fill="currentColor"
d="M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z"
/>
</svg>
<div class="px-3">
<p class="text-4xl md:text-5xl font-bold">{{ userAudiobooksRead.length }}</p>
<p class="font-book text-xs md:text-sm text-white text-opacity-80">Books Read</p>
</div>
</div>
<div class="flex md:flex-row flex-wrap justify-between flex-col mt-12"> <div class="flex p-2">
<div class="w-80 my-6 mx-auto"> <span class="material-icons-outlined" style="font-size: 4.1rem">event</span>
<h1 class="text-2xl mb-4 font-book">Top 5 Genres</h1> <div class="px-1">
<template v-for="genre in top5Genres"> <p class="text-4xl md:text-5xl font-bold">{{ totalDaysListened }}</p>
<div :key="genre.genre" class="w-full py-2"> <p class="font-book text-xs md:text-sm text-white text-opacity-80">Days Listened</p>
<div class="flex items-end mb-1"> </div>
<p class="text-2xl font-bold">{{ Math.round((100 * genre.count) / totalBooks) }}&nbsp;%</p>
<div class="flex-grow" />
<p class="text-base font-book text-white text-opacity-70">{{ genre.genre }}</p>
</div>
<div class="w-full rounded-full h-3 bg-primary bg-opacity-50 overflow-hidden">
<div class="bg-yellow-400 h-full rounded-full" :style="{ width: Math.round((100 * genre.count) / totalBooks) + '%' }" />
</div>
</div>
</template>
</div> </div>
<div class="w-80 my-6 mx-auto">
<h1 class="text-2xl mb-4 font-book">Top 10 Authors</h1> <div class="flex p-2">
<template v-for="(author, index) in top10Authors"> <span class="material-icons-outlined" style="font-size: 4.1rem">watch_later</span>
<div :key="author.author" class="w-full py-2"> <div class="px-1">
<div class="flex items-center mb-1"> <p class="text-4xl md:text-5xl font-bold">{{ totalMinutesListening }}</p>
<p class="text-sm font-book text-white text-opacity-70 w-36 pr-2 truncate">{{ index + 1 }}.&nbsp;&nbsp;&nbsp;&nbsp;{{ author.author }}</p> <p class="font-book text-xs md:text-sm text-white text-opacity-80">Minutes Listening</p>
<div class="flex-grow rounded-full h-2.5 bg-primary bg-opacity-0 overflow-hidden"> </div>
<div class="bg-yellow-400 h-full rounded-full" :style="{ width: Math.round((100 * author.count) / mostUsedAuthorCount) + '%' }" />
</div>
<div class="w-4 ml-3">
<p class="text-sm font-bold">{{ author.count }}</p>
</div>
</div>
</div>
</template>
</div> </div>
</div>
<div class="flex">
<stats-daily-listening-chart :listening-stats="listeningStats" /> <stats-daily-listening-chart :listening-stats="listeningStats" />
<div class="w-80 my-6 mx-auto">
<h1 class="text-2xl mb-4 font-book">Recent Listening Sessions</h1>
<p v-if="!mostRecentListeningSessions.length">No Listening Sessions</p>
<template v-for="(book, index) in mostRecentListeningSessions">
<div :key="book.id" class="w-full py-0.5">
<div class="flex items-center mb-1">
<p class="text-sm font-book text-white text-opacity-70 w-6 truncate">{{ index + 1 }}.&nbsp;</p>
<div class="w-56">
<p class="text-sm font-book text-white text-opacity-80 truncate">{{ book.audiobookTitle }}</p>
<p class="text-xs text-white text-opacity-50">{{ $dateDistanceFromNow(book.lastUpdate) }}</p>
</div>
<div class="flex-grow" />
<div class="w-18 text-right">
<p class="text-sm font-bold">{{ $elapsedPretty(book.timeListening) }}</p>
</div>
</div>
</div>
</template>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -58,27 +74,31 @@ export default {
user() { user() {
return this.$store.state.user.user return this.$store.state.user.user
}, },
totalBooks() {
return this.libraryStats ? this.libraryStats.totalBooks : 0
},
genresWithCount() {
return this.libraryStats ? this.libraryStats.genresWithCount : []
},
top5Genres() {
return this.genresWithCount.slice(0, 5)
},
authorsWithCount() {
return this.libraryStats ? this.libraryStats.authorsWithCount : []
},
mostUsedAuthorCount() {
if (!this.authorsWithCount.length) return 0
return this.authorsWithCount[0].count
},
top10Authors() {
return this.authorsWithCount.slice(0, 10)
},
currentLibraryId() { currentLibraryId() {
return this.$store.state.libraries.currentLibraryId return this.$store.state.libraries.currentLibraryId
},
userAudiobooks() {
return Object.values(this.user.audiobooks || {})
},
userAudiobooksRead() {
return this.userAudiobooks.filter((ab) => !!ab.isRead)
},
mostRecentBooksListened() {
if (!this.listeningStats) return []
var sorted = Object.values(this.listeningStats.books || {}).sort((a, b) => b.lastUpdate - a.lastUpdate)
return sorted.slice(0, 10)
},
mostRecentListeningSessions() {
if (!this.listeningStats) return []
return this.listeningStats.recentSessions || []
},
totalMinutesListening() {
if (!this.listeningStats) return 0
return Math.round(this.listeningStats.totalTime / 60)
},
totalDaysListened() {
if (!this.listeningStats) return 0
return Object.values(this.listeningStats.days).length
} }
}, },
methods: { methods: {
@ -88,7 +108,6 @@ export default {
var errorMsg = err.response ? err.response.data || 'Unknown Error' : 'Unknown Error' var errorMsg = err.response ? err.response.data || 'Unknown Error' : 'Unknown Error'
this.$toast.error(`Failed to get library stats: ${errorMsg}`) this.$toast.error(`Failed to get library stats: ${errorMsg}`)
}) })
console.log('lib stats', this.libraryStats)
this.listeningStats = await this.$axios.$get(`/api/me/listening-stats`).catch((err) => { this.listeningStats = await this.$axios.$get(`/api/me/listening-stats`).catch((err) => {
console.error('Failed to load listening sesions', err) console.error('Failed to load listening sesions', err)
return [] return []

View File

@ -15,10 +15,16 @@ const BookCoverAspectRatio = {
SQUARE: 1 SQUARE: 1
} }
const BookshelfView = {
STANDARD: 0,
TITLES: 1
}
const Constants = { const Constants = {
DownloadStatus, DownloadStatus,
CoverDestination, CoverDestination,
BookCoverAspectRatio BookCoverAspectRatio,
BookshelfView
} }
const KeyNames = { const KeyNames = {

View File

@ -13,6 +13,11 @@ export const getters = {
getCurrentLibrary: state => { getCurrentLibrary: state => {
return state.libraries.find(lib => lib.id === state.currentLibraryId) return state.libraries.find(lib => lib.id === state.currentLibraryId)
}, },
getCurrentLibraryName: (state, getters) => {
var currentLibrary = getters.getCurrentLibrary
if (!currentLibrary) return ''
return currentLibrary.name
},
getSortedLibraries: state => () => { getSortedLibraries: state => () => {
return state.libraries.map(lib => ({ ...lib })).sort((a, b) => a.displayOrder - b.displayOrder) return state.libraries.map(lib => ({ ...lib })).sort((a, b) => a.displayOrder - b.displayOrder)
} }
@ -182,7 +187,8 @@ export const mutations = {
genres: [], genres: [],
tags: [], tags: [],
series: [], series: [],
narrators: [] narrators: [],
languages: []
} }
*/ */
@ -213,5 +219,8 @@ export const mutations = {
if (genre && !state.filterData.genres.includes(genre)) state.filterData.genres.push(genre) if (genre && !state.filterData.genres.includes(genre)) state.filterData.genres.push(genre)
}) })
} }
if (audiobook.book.language && !state.filterData.languages.includes(audiobook.book.language)) {
state.filterData.languages.push(audiobook.book.language)
}
} }
} }

View File

@ -1,5 +1,19 @@
export const state = () => ({ export const state = () => ({
libraryScans: [] libraryScans: [],
providers: [
{
text: 'Google Books',
value: 'google'
},
{
text: 'Open Library',
value: 'openlibrary'
},
{
text: 'Audible',
value: 'audible'
}
]
}) })
export const getters = { export const getters = {

View File

@ -12,6 +12,7 @@ if (isDev) {
process.env.METADATA_PATH = devEnv.MetadataPath process.env.METADATA_PATH = devEnv.MetadataPath
process.env.AUDIOBOOK_PATH = devEnv.AudiobookPath process.env.AUDIOBOOK_PATH = devEnv.AudiobookPath
process.env.FFMPEG_PATH = devEnv.FFmpegPath process.env.FFMPEG_PATH = devEnv.FFmpegPath
process.env.FFPROBE_PATH = devEnv.FFProbePath
} }
const PORT = process.env.PORT || 80 const PORT = process.env.PORT || 80

239
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "audiobookshelf", "name": "audiobookshelf",
"version": "1.6.39", "version": "1.6.53",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -105,12 +105,14 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
"optional": true
}, },
"archiver": { "archiver": {
"version": "5.3.0", "version": "5.3.0",
@ -171,6 +173,7 @@
"version": "1.1.7", "version": "1.1.7",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz",
"integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==",
"optional": true,
"requires": { "requires": {
"delegates": "^1.0.0", "delegates": "^1.0.0",
"readable-stream": "^2.0.6" "readable-stream": "^2.0.6"
@ -180,6 +183,7 @@
"version": "2.3.7", "version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"optional": true,
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
"inherits": "~2.0.3", "inherits": "~2.0.3",
@ -342,7 +346,8 @@
"chownr": { "chownr": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
"optional": true
}, },
"clone-response": { "clone-response": {
"version": "1.0.2", "version": "1.0.2",
@ -355,38 +360,8 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
}, "optional": true
"color": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/color/-/color-4.1.0.tgz",
"integrity": "sha512-o2rkkxyLGgYoeUy1OodXpbPAQNmlNBrirQ8ODO8QutzDiDMNdezSOZLNnusQ6pUpCQJUsaJIo9DZJKqa2HgH7A==",
"requires": {
"color-convert": "^2.0.1",
"color-string": "^1.9.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"color-string": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz",
"integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==",
"requires": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"
}
}, },
"command-line-args": { "command-line-args": {
"version": "5.2.0", "version": "5.2.0",
@ -423,7 +398,8 @@
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"optional": true
}, },
"content-disposition": { "content-disposition": {
"version": "0.5.3", "version": "0.5.3",
@ -516,7 +492,8 @@
"deep-extend": { "deep-extend": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"optional": true
}, },
"defer-to-connect": { "defer-to-connect": {
"version": "2.0.1", "version": "2.0.1",
@ -526,7 +503,8 @@
"delegates": { "delegates": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
"optional": true
}, },
"depd": { "depd": {
"version": "1.1.2", "version": "1.1.2",
@ -541,7 +519,8 @@
"detect-libc": { "detect-libc": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
"optional": true
}, },
"dicer": { "dicer": {
"version": "0.3.0", "version": "0.3.0",
@ -644,11 +623,6 @@
"resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz", "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
"integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==" "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw=="
}, },
"expand-template": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="
},
"express": { "express": {
"version": "4.17.1", "version": "4.17.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
@ -788,6 +762,7 @@
"version": "2.7.4", "version": "2.7.4",
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"optional": true,
"requires": { "requires": {
"aproba": "^1.0.3", "aproba": "^1.0.3",
"console-control-strings": "^1.0.0", "console-control-strings": "^1.0.0",
@ -807,11 +782,6 @@
"pump": "^3.0.0" "pump": "^3.0.0"
} }
}, },
"github-from-package": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
"integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4="
},
"glob": { "glob": {
"version": "7.1.7", "version": "7.1.7",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
@ -852,7 +822,8 @@
"has-unicode": { "has-unicode": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
"optional": true
}, },
"html-entities": { "html-entities": {
"version": "2.3.2", "version": "2.3.2",
@ -932,7 +903,8 @@
"ini": { "ini": {
"version": "1.3.8", "version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
"optional": true
}, },
"ip": { "ip": {
"version": "1.1.5", "version": "1.1.5",
@ -944,15 +916,11 @@
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
}, },
"is-arrayish": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
},
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -1149,21 +1117,6 @@
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
"integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA=="
}, },
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
},
"dependencies": {
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
},
"media-typer": { "media-typer": {
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@ -1213,7 +1166,8 @@
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",
@ -1243,11 +1197,6 @@
"minimist": "^1.2.5" "minimist": "^1.2.5"
} }
}, },
"mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
},
"moment": { "moment": {
"version": "2.29.1", "version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
@ -1272,11 +1221,6 @@
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
"optional": true "optional": true
}, },
"napi-build-utils": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
},
"needle": { "needle": {
"version": "2.9.1", "version": "2.9.1",
"resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz",
@ -1318,29 +1262,6 @@
"proper-lockfile": "^4.1.2" "proper-lockfile": "^4.1.2"
} }
}, },
"node-abi": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.5.0.tgz",
"integrity": "sha512-LtHvNIBgOy5mO8mPEUtkCW/YCRWYEKshIvqhe1GHHyXEHEB5mgICyYnAcl4qan3uFeRROErKGzatFHPf6kDxWw==",
"requires": {
"semver": "^7.3.5"
},
"dependencies": {
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"requires": {
"lru-cache": "^6.0.0"
}
}
}
},
"node-addon-api": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.2.0.tgz",
"integrity": "sha512-eazsqzwG2lskuzBqCGPi7Ac2UgOoMz8JVOXVhTvvPDYhthvNpefx8jWD8Np7Gv+2Sz0FlPWZk0nJV0z598Wn8Q=="
},
"node-cron": { "node-cron": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.0.tgz", "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.0.tgz",
@ -1349,6 +1270,11 @@
"moment-timezone": "^0.5.31" "moment-timezone": "^0.5.31"
} }
}, },
"node-ffprobe": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/node-ffprobe/-/node-ffprobe-3.0.0.tgz",
"integrity": "sha512-2LNTLStz2hw/urwo4xJ00TIOvthgepcl3tF4HB8BWnhJ4nhJ7S08YThapBHkGLYV+GUuY9pML/kX76+dqY2iUg=="
},
"node-pre-gyp": { "node-pre-gyp": {
"version": "0.10.3", "version": "0.10.3",
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz", "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz",
@ -1422,6 +1348,7 @@
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"optional": true,
"requires": { "requires": {
"are-we-there-yet": "~1.1.2", "are-we-there-yet": "~1.1.2",
"console-control-strings": "~1.1.0", "console-control-strings": "~1.1.0",
@ -1432,7 +1359,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -1520,26 +1448,6 @@
"rss": "^1.2.2" "rss": "^1.2.2"
} }
}, },
"prebuild-install": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.0.0.tgz",
"integrity": "sha512-IvSenf33K7JcgddNz2D5w521EgO+4aMMjFt73Uk9FRzQ7P+QZPKrp7qPsDydsSwjGt3T5xRNnM1bj1zMTD5fTA==",
"requires": {
"detect-libc": "^1.0.3",
"expand-template": "^2.0.3",
"github-from-package": "0.0.0",
"minimist": "^1.2.3",
"mkdirp-classic": "^0.5.3",
"napi-build-utils": "^1.0.1",
"node-abi": "^3.3.0",
"npmlog": "^4.0.1",
"pump": "^3.0.0",
"rc": "^1.2.7",
"simple-get": "^4.0.0",
"tar-fs": "^2.0.0",
"tunnel-agent": "^0.6.0"
}
},
"printj": { "printj": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz", "resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
@ -1651,6 +1559,7 @@
"version": "1.2.8", "version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
"optional": true,
"requires": { "requires": {
"deep-extend": "^0.6.0", "deep-extend": "^0.6.0",
"ini": "~1.3.0", "ini": "~1.3.0",
@ -1815,66 +1724,19 @@
"set-blocking": { "set-blocking": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"optional": true
}, },
"setprototypeof": { "setprototypeof": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
}, },
"sharp": {
"version": "0.29.3",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.29.3.tgz",
"integrity": "sha512-fKWUuOw77E4nhpyzCCJR1ayrttHoFHBT2U/kR/qEMRhvPEcluG4BKj324+SCO1e84+knXHwhJ1HHJGnUt4ElGA==",
"requires": {
"color": "^4.0.1",
"detect-libc": "^1.0.3",
"node-addon-api": "^4.2.0",
"prebuild-install": "^7.0.0",
"semver": "^7.3.5",
"simple-get": "^4.0.0",
"tar-fs": "^2.1.1",
"tunnel-agent": "^0.6.0"
},
"dependencies": {
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"requires": {
"lru-cache": "^6.0.0"
}
}
}
},
"signal-exit": { "signal-exit": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
}, },
"simple-concat": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
"integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="
},
"simple-get": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.0.tgz",
"integrity": "sha512-ZalZGexYr3TA0SwySsr5HlgOOinS4Jsa8YB2GJ6lUNAazyAu4KG/VmzMTwAt2YVXzzVj8QmefmAonZIK2BSGcQ==",
"requires": {
"decompress-response": "^6.0.0",
"once": "^1.3.1",
"simple-concat": "^1.0.0"
}
},
"simple-swizzle": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
"integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=",
"requires": {
"is-arrayish": "^0.3.1"
}
},
"socket.io": { "socket.io": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.1.3.tgz", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.1.3.tgz",
@ -1996,6 +1858,7 @@
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -2014,6 +1877,7 @@
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -2021,7 +1885,8 @@
"strip-json-comments": { "strip-json-comments": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
"optional": true
}, },
"tar": { "tar": {
"version": "4.4.19", "version": "4.4.19",
@ -2046,17 +1911,6 @@
} }
} }
}, },
"tar-fs": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
"requires": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.1.4"
}
},
"tar-stream": { "tar-stream": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
@ -2082,14 +1936,6 @@
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
}, },
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"type-is": { "type-is": {
"version": "1.6.18", "version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@ -2154,6 +2000,7 @@
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
"optional": true,
"requires": { "requires": {
"string-width": "^1.0.2 || 2" "string-width": "^1.0.2 || 2"
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "audiobookshelf", "name": "audiobookshelf",
"version": "1.6.48", "version": "1.6.59",
"description": "Self-hosted audiobook server for managing and playing audiobooks", "description": "Self-hosted audiobook server for managing and playing audiobooks",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -10,18 +10,22 @@
"prod": "npm run client && npm install && node prod.js", "prod": "npm run client && npm install && node prod.js",
"build-win": "pkg -t node12-win-x64 -o ./dist/win/audiobookshelf .", "build-win": "pkg -t node12-win-x64 -o ./dist/win/audiobookshelf .",
"build-linux": "build/linuxpackager", "build-linux": "build/linuxpackager",
"docker": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push . -t advplyr/audiobookshelf" "docker": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push . -t advplyr/audiobookshelf",
"deploy": "node dist/autodeploy"
}, },
"bin": "prod.js", "bin": "prod.js",
"pkg": { "pkg": {
"assets": "client/dist/**/*", "assets": [
"client/dist/**/*",
"server/Db.js"
],
"scripts": [ "scripts": [
"prod.js", "prod.js",
"server/**/*.js" "server/**/*.js"
] ]
}, },
"author": "advplyr", "author": "advplyr",
"license": "ISC", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"archiver": "^5.3.0", "archiver": "^5.3.0",
"axios": "^0.21.1", "axios": "^0.21.1",
@ -40,6 +44,7 @@
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"libgen": "^2.1.0", "libgen": "^2.1.0",
"njodb": "^0.4.27", "njodb": "^0.4.27",
"node-ffprobe": "^3.0.0",
"node-cron": "^3.0.0", "node-cron": "^3.0.0",
"node-stream-zip": "^1.15.0", "node-stream-zip": "^1.15.0",
"podcast": "^1.3.0", "podcast": "^1.3.0",

View File

@ -18,7 +18,7 @@ Audiobookshelf is a self-hosted audiobook server for managing and playing your a
### Features ### Features
* Fully **open-source**, including the [android app](https://github.com/advplyr/audiobookshelf-app) *(in beta)* * Fully **open-source**, including the [android & iOS app](https://github.com/advplyr/audiobookshelf-app) *(in beta)*
* Stream all audiobook formats on the fly * Stream all audiobook formats on the fly
* Multi-user support w/ custom permissions * Multi-user support w/ custom permissions
* Keeps progress per user and syncs across devices * Keeps progress per user and syncs across devices
@ -30,6 +30,8 @@ Is there a feature you are looking for? [Suggest it](https://github.com/advplyr/
Android app is in beta, try it out on the [Google Play Store](https://play.google.com/store/apps/details?id=com.audiobookshelf.app) Android app is in beta, try it out on the [Google Play Store](https://play.google.com/store/apps/details?id=com.audiobookshelf.app)
iOS early beta available using Test Flight: https://testflight.apple.com/join/wiic7QIW - [Join the discussion](https://github.com/advplyr/audiobookshelf-app/discussions/60)
<img alt="Library Screenshot" src="https://github.com/advplyr/audiobookshelf/raw/master/images/LibraryStream.png" /> <img alt="Library Screenshot" src="https://github.com/advplyr/audiobookshelf/raw/master/images/LibraryStream.png" />
## Organizing your audiobooks ## Organizing your audiobooks
@ -50,6 +52,8 @@ Available in Unraid Community Apps
docker pull advplyr/audiobookshelf docker pull advplyr/audiobookshelf
docker run -d \ docker run -d \
-e AUDIOBOOKSHELF_UID=99 \
-e AUDIOBOOKSHELF_GID=100 \
-p 13378:80 \ -p 13378:80 \
-v </path/to/audiobooks>:/audiobooks \ -v </path/to/audiobooks>:/audiobooks \
-v </path/to/config>:/config \ -v </path/to/config>:/config \
@ -189,17 +193,7 @@ For this to work you must enable at least the following mods using `a2enmod`:
## Run from source ## Run from source
Note: you will need `npm`, `node12`, and `ffmpeg` to run this project locally [See discussion](https://github.com/advplyr/audiobookshelf/discussions/259#discussioncomment-1869729)
```bash
git clone https://github.com/advplyr/audiobookshelf.git
cd audiobookshelf
# All paths default to root directory. Config path is the database.
# Directories will be created if they don't exist
# Paths are relative to the root directory, so "../Audiobooks" would be a valid path
npm run prod -- -p [PORT] --audiobooks [AUDIOBOOKS_PATH] --config [CONFIG_PATH] --metadata [METADATA_PATH]
```
## Contributing / How to Support ## Contributing / How to Support

View File

@ -458,14 +458,15 @@ class ApiController {
books: {}, books: {},
days: {}, days: {},
dayOfWeek: {}, dayOfWeek: {},
today: 0 today: 0,
recentSessions: listeningSessions.slice(0, 10)
} }
listeningSessions.forEach((s) => { listeningSessions.forEach((s) => {
if (s.dayOfWeek) { if (s.dayOfWeek) {
if (!listeningStats.dayOfWeek[s.dayOfWeek]) listeningStats.dayOfWeek[s.dayOfWeek] = 0 if (!listeningStats.dayOfWeek[s.dayOfWeek]) listeningStats.dayOfWeek[s.dayOfWeek] = 0
listeningStats.dayOfWeek[s.dayOfWeek] += s.timeListening listeningStats.dayOfWeek[s.dayOfWeek] += s.timeListening
} }
if (s.date) { if (s.date && s.timeListening > 0) {
if (!listeningStats.days[s.date]) listeningStats.days[s.date] = 0 if (!listeningStats.days[s.date]) listeningStats.days[s.date] = 0
listeningStats.days[s.date] += s.timeListening listeningStats.days[s.date] += s.timeListening
@ -473,8 +474,17 @@ class ApiController {
listeningStats.today += s.timeListening listeningStats.today += s.timeListening
} }
} }
if (!listeningStats.books[s.audiobookId]) listeningStats.books[s.audiobookId] = 0 if (!listeningStats.books[s.audiobookId]) {
listeningStats.books[s.audiobookId] += s.timeListening listeningStats.books[s.audiobookId] = {
id: s.audiobookId,
timeListening: s.timeListening,
title: s.audiobookTitle,
author: s.audiobookAuthor,
lastUpdate: s.lastUpdate
}
} else {
listeningStats.books[s.audiobookId].timeListening += s.timeListening
}
listeningStats.totalTime += s.timeListening listeningStats.totalTime += s.timeListening
}) })

View File

@ -120,6 +120,7 @@ class FolderWatcher extends EventEmitter {
onRename(libraryId, pathFrom, pathTo) { onRename(libraryId, pathFrom, pathTo) {
Logger.debug(`[Watcher] Rename ${pathFrom} => ${pathTo}`) Logger.debug(`[Watcher] Rename ${pathFrom} => ${pathTo}`)
this.addFileUpdate(libraryId, pathFrom, 'renamed')
this.addFileUpdate(libraryId, pathTo, 'renamed') this.addFileUpdate(libraryId, pathTo, 'renamed')
} }

View File

@ -1,4 +1,5 @@
const Logger = require('../Logger') const Logger = require('../Logger')
const Path = require('path')
class FileSystemController { class FileSystemController {
constructor() { } constructor() { }

View File

@ -29,6 +29,11 @@ class LibraryController {
} }
findAll(req, res) { findAll(req, res) {
var librariesAccessible = req.user.librariesAccessible || []
if (librariesAccessible && librariesAccessible.length) {
return res.json(this.db.libraries.filter(lib => librariesAccessible.includes(lib.id)).map(lib => lib.toJSON()))
}
res.json(this.db.libraries.map(lib => lib.toJSON())) res.json(this.db.libraries.map(lib => lib.toJSON()))
} }
@ -167,6 +172,7 @@ class LibraryController {
} }
var series = libraryHelpers.getSeriesFromBooks(audiobooks, payload.minified) var series = libraryHelpers.getSeriesFromBooks(audiobooks, payload.minified)
series = sort(series).asc(s => s.name)
payload.total = series.length payload.total = series.length
if (payload.limit) { if (payload.limit) {
@ -174,7 +180,7 @@ class LibraryController {
series = series.slice(startIndex, startIndex + payload.limit) series = series.slice(startIndex, startIndex + payload.limit)
} }
payload.results = sort(series).asc(s => s.name) payload.results = series
res.json(payload) res.json(payload)
} }
@ -375,11 +381,14 @@ class LibraryController {
var authorsWithCount = libraryHelpers.getAuthorsWithCount(audiobooksInLibrary) var authorsWithCount = libraryHelpers.getAuthorsWithCount(audiobooksInLibrary)
var genresWithCount = libraryHelpers.getGenresWithCount(audiobooksInLibrary) var genresWithCount = libraryHelpers.getGenresWithCount(audiobooksInLibrary)
var abDurationStats = libraryHelpers.getAudiobookDurationStats(audiobooksInLibrary)
var stats = { var stats = {
totalBooks: audiobooksInLibrary.length, totalBooks: audiobooksInLibrary.length,
totalAuthors: Object.keys(authorsWithCount).length, totalAuthors: Object.keys(authorsWithCount).length,
totalGenres: Object.keys(genresWithCount).length, totalGenres: Object.keys(genresWithCount).length,
totalDuration: libraryHelpers.getAudiobooksTotalDuration(audiobooksInLibrary), totalDuration: abDurationStats.totalDuration,
longestAudiobooks: abDurationStats.longstAudiobooks,
numAudioTracks: abDurationStats.numAudioTracks,
totalSize: libraryHelpers.getAudiobooksTotalSize(audiobooksInLibrary), totalSize: libraryHelpers.getAudiobooksTotalSize(audiobooksInLibrary),
authorsWithCount, authorsWithCount,
genresWithCount genresWithCount
@ -409,6 +418,12 @@ class LibraryController {
} }
middleware(req, res, next) { middleware(req, res, next) {
var librariesAccessible = req.user.librariesAccessible || []
if (librariesAccessible && librariesAccessible.length && !librariesAccessible.includes(req.params.id)) {
Logger.warn(`[LibraryController] Library ${req.params.id} not accessible to user ${req.user.username}`)
return res.sendStatus(404)
}
var library = this.db.libraries.find(lib => lib.id === req.params.id) var library = this.db.libraries.find(lib => lib.id === req.params.id)
if (!library) { if (!library) {
return res.status(404).send('Library not found') return res.status(404).send('Library not found')

View File

@ -40,7 +40,7 @@ class MeController {
if (!audiobook) { if (!audiobook) {
return res.status(404).send('Audiobook not found') return res.status(404).send('Audiobook not found')
} }
var wasUpdated = req.user.updateAudiobookData(audiobook, req.body) var wasUpdated = req.user.updateAudiobookData(audiobook.id, req.body)
if (wasUpdated) { if (wasUpdated) {
await this.db.updateEntity('user', req.user) await this.db.updateEntity('user', req.user)
this.clientEmitter(req.user.id, 'user_updated', req.user.toJSONForBrowser()) this.clientEmitter(req.user.id, 'user_updated', req.user.toJSONForBrowser())
@ -59,7 +59,7 @@ class MeController {
userAbDataPayloads.forEach((userAbData) => { userAbDataPayloads.forEach((userAbData) => {
var audiobook = this.db.audiobooks.find(ab => ab.id === userAbData.audiobookId) var audiobook = this.db.audiobooks.find(ab => ab.id === userAbData.audiobookId)
if (audiobook) { if (audiobook) {
var wasUpdated = req.user.updateAudiobookData(audiobook, userAbData) var wasUpdated = req.user.updateAudiobookData(audiobook.id, userAbData)
if (wasUpdated) shouldUpdate = true if (wasUpdated) shouldUpdate = true
} }
}) })

View File

@ -14,8 +14,9 @@ class AudioFile {
this.addedAt = null this.addedAt = null
this.trackNumFromMeta = null this.trackNumFromMeta = null
this.discNumFromMeta = null
this.trackNumFromFilename = null this.trackNumFromFilename = null
this.cdNumFromFilename = null this.discNumFromFilename = null
this.format = null this.format = null
this.duration = null this.duration = null
@ -42,16 +43,6 @@ class AudioFile {
} }
} }
// Sort number takes cd num into account
// get sortNumber() {
// if (this.manuallyVerified) return this.index
// var num = this.index
// if (this.cdNumFromFilename && !isNaN(this.cdNumFromFilename)) {
// num += (Number(this.cdNumFromFilename) * 1000)
// }
// return num
// }
toJSON() { toJSON() {
return { return {
index: this.index, index: this.index,
@ -62,8 +53,9 @@ class AudioFile {
fullPath: this.fullPath, fullPath: this.fullPath,
addedAt: this.addedAt, addedAt: this.addedAt,
trackNumFromMeta: this.trackNumFromMeta, trackNumFromMeta: this.trackNumFromMeta,
discNumFromMeta: this.discNumFromMeta,
trackNumFromFilename: this.trackNumFromFilename, trackNumFromFilename: this.trackNumFromFilename,
cdNumFromFilename: this.cdNumFromFilename, discNumFromFilename: this.discNumFromFilename,
manuallyVerified: !!this.manuallyVerified, manuallyVerified: !!this.manuallyVerified,
invalid: !!this.invalid, invalid: !!this.invalid,
exclude: !!this.exclude, exclude: !!this.exclude,
@ -97,8 +89,11 @@ class AudioFile {
this.error = data.error || null this.error = data.error || null
this.trackNumFromMeta = data.trackNumFromMeta this.trackNumFromMeta = data.trackNumFromMeta
this.discNumFromMeta = data.discNumFromMeta
this.trackNumFromFilename = data.trackNumFromFilename this.trackNumFromFilename = data.trackNumFromFilename
this.cdNumFromFilename = data.cdNumFromFilename
if (data.cdNumFromFilename !== undefined) this.discNumFromFilename = data.cdNumFromFilename // TEMP:Support old var name
else this.discNumFromFilename = data.discNumFromFilename
this.format = data.format this.format = data.format
this.duration = data.duration this.duration = data.duration
@ -132,8 +127,9 @@ class AudioFile {
this.addedAt = Date.now() this.addedAt = Date.now()
this.trackNumFromMeta = fileData.trackNumFromMeta this.trackNumFromMeta = fileData.trackNumFromMeta
this.discNumFromMeta = fileData.discNumFromMeta
this.trackNumFromFilename = fileData.trackNumFromFilename this.trackNumFromFilename = fileData.trackNumFromFilename
this.cdNumFromFilename = fileData.cdNumFromFilename this.discNumFromFilename = fileData.discNumFromFilename
this.format = probeData.format this.format = probeData.format
this.duration = probeData.duration this.duration = probeData.duration

View File

@ -7,6 +7,7 @@ class AudioFileMetadata {
this.tagSeries = null this.tagSeries = null
this.tagSeriesPart = null this.tagSeriesPart = null
this.tagTrack = null this.tagTrack = null
this.tagDisc = null
this.tagSubtitle = null this.tagSubtitle = null
this.tagAlbumArtist = null this.tagAlbumArtist = null
this.tagDate = null this.tagDate = null
@ -16,6 +17,9 @@ class AudioFileMetadata {
this.tagDescription = null this.tagDescription = null
this.tagEncoder = null this.tagEncoder = null
this.tagEncodedBy = null this.tagEncodedBy = null
this.tagIsbn = null
this.tagLanguage = null
this.tagASIN = null
if (metadata) { if (metadata) {
this.construct(metadata) this.construct(metadata)
@ -41,6 +45,7 @@ class AudioFileMetadata {
this.tagSeries = metadata.tagSeries || null this.tagSeries = metadata.tagSeries || null
this.tagSeriesPart = metadata.tagSeriesPart || null this.tagSeriesPart = metadata.tagSeriesPart || null
this.tagTrack = metadata.tagTrack || null this.tagTrack = metadata.tagTrack || null
this.tagDisc = metadata.tagDisc || null
this.tagSubtitle = metadata.tagSubtitle || null this.tagSubtitle = metadata.tagSubtitle || null
this.tagAlbumArtist = metadata.tagAlbumArtist || null this.tagAlbumArtist = metadata.tagAlbumArtist || null
this.tagDate = metadata.tagDate || null this.tagDate = metadata.tagDate || null
@ -50,6 +55,9 @@ class AudioFileMetadata {
this.tagDescription = metadata.tagDescription || null this.tagDescription = metadata.tagDescription || null
this.tagEncoder = metadata.tagEncoder || null this.tagEncoder = metadata.tagEncoder || null
this.tagEncodedBy = metadata.tagEncodedBy || null this.tagEncodedBy = metadata.tagEncodedBy || null
this.tagIsbn = metadata.tagIsbn || null
this.tagLanguage = metadata.tagLanguage || null
this.tagASIN = metadata.tagASIN || null
} }
// Data parsed in prober.js // Data parsed in prober.js
@ -61,6 +69,7 @@ class AudioFileMetadata {
this.tagSeries = payload.file_tag_series || null this.tagSeries = payload.file_tag_series || null
this.tagSeriesPart = payload.file_tag_seriespart || null this.tagSeriesPart = payload.file_tag_seriespart || null
this.tagTrack = payload.file_tag_track || null this.tagTrack = payload.file_tag_track || null
this.tagDisc = payload.file_tag_disc || null
this.tagSubtitle = payload.file_tag_subtitle || null this.tagSubtitle = payload.file_tag_subtitle || null
this.tagAlbumArtist = payload.file_tag_albumartist || null this.tagAlbumArtist = payload.file_tag_albumartist || null
this.tagDate = payload.file_tag_date || null this.tagDate = payload.file_tag_date || null
@ -70,6 +79,9 @@ class AudioFileMetadata {
this.tagDescription = payload.file_tag_description || null this.tagDescription = payload.file_tag_description || null
this.tagEncoder = payload.file_tag_encoder || null this.tagEncoder = payload.file_tag_encoder || null
this.tagEncodedBy = payload.file_tag_encodedby || null this.tagEncodedBy = payload.file_tag_encodedby || null
this.tagIsbn = payload.file_tag_isbn || null
this.tagLanguage = payload.file_tag_language || null
this.tagASIN = payload.file_tag_asin || null
} }
updateData(payload) { updateData(payload) {
@ -81,6 +93,7 @@ class AudioFileMetadata {
tagSeries: payload.file_tag_series || null, tagSeries: payload.file_tag_series || null,
tagSeriesPart: payload.file_tag_seriespart || null, tagSeriesPart: payload.file_tag_seriespart || null,
tagTrack: payload.file_tag_track || null, tagTrack: payload.file_tag_track || null,
tagDisc: payload.file_tag_disc || null,
tagSubtitle: payload.file_tag_subtitle || null, tagSubtitle: payload.file_tag_subtitle || null,
tagAlbumArtist: payload.file_tag_albumartist || null, tagAlbumArtist: payload.file_tag_albumartist || null,
tagDate: payload.file_tag_date || null, tagDate: payload.file_tag_date || null,
@ -89,7 +102,10 @@ class AudioFileMetadata {
tagComment: payload.file_tag_comment || null, tagComment: payload.file_tag_comment || null,
tagDescription: payload.file_tag_description || null, tagDescription: payload.file_tag_description || null,
tagEncoder: payload.file_tag_encoder || null, tagEncoder: payload.file_tag_encoder || null,
tagEncodedBy: payload.file_tag_encodedby || null tagEncodedBy: payload.file_tag_encodedby || null,
tagIsbn: payload.file_tag_isbn || null,
tagLanguage: payload.file_tag_language || null,
tagASIN: payload.file_tag_asin || null
} }
var hasUpdates = false var hasUpdates = false

View File

@ -18,7 +18,8 @@ class Book {
this.publisher = null this.publisher = null
this.description = null this.description = null
this.isbn = null this.isbn = null
this.langauge = null this.asin = null
this.language = null
this.cover = null this.cover = null
this.coverFullPath = null this.coverFullPath = null
this.genres = [] this.genres = []
@ -43,6 +44,9 @@ class Book {
get _authorsList() { return this._author.split(', ') } get _authorsList() { return this._author.split(', ') }
get _narratorsList() { return this._narrator.split(', ') } get _narratorsList() { return this._narrator.split(', ') }
get _genres() { return this.genres || [] } get _genres() { return this.genres || [] }
get _language() { return this.language || '' }
get _isbn() { return this.isbn || '' }
get _asin() { return this.asin || '' }
get shouldSearchForCover() { get shouldSearchForCover() {
if (this.cover) return false if (this.cover) return false
@ -66,6 +70,7 @@ class Book {
this.publisher = book.publisher this.publisher = book.publisher
this.description = book.description this.description = book.description
this.isbn = book.isbn || null this.isbn = book.isbn || null
this.asin = book.asin || null
this.language = book.language || null this.language = book.language || null
this.cover = book.cover this.cover = book.cover
this.coverFullPath = book.coverFullPath || null this.coverFullPath = book.coverFullPath || null
@ -97,6 +102,7 @@ class Book {
publisher: this.publisher, publisher: this.publisher,
description: this.description, description: this.description,
isbn: this.isbn, isbn: this.isbn,
asin: this.asin,
language: this.language, language: this.language,
cover: this.cover, cover: this.cover,
coverFullPath: this.coverFullPath, coverFullPath: this.coverFullPath,
@ -155,6 +161,7 @@ class Book {
this.publishYear = data.publishYear || null this.publishYear = data.publishYear || null
this.description = data.description || null this.description = data.description || null
this.isbn = data.isbn || null this.isbn = data.isbn || null
this.asin = data.asin || null
this.language = data.language || null this.language = data.language || null
this.cover = data.cover || null this.cover = data.cover || null
this.coverFullPath = data.coverFullPath || null this.coverFullPath = data.coverFullPath || null
@ -279,7 +286,13 @@ class Book {
// var authorMatch = this._author.toLowerCase().includes(search) // var authorMatch = this._author.toLowerCase().includes(search)
var seriesMatch = this._series.toLowerCase().includes(search) var seriesMatch = this._series.toLowerCase().includes(search)
var bookMatchKey = titleMatch ? 'title' : subtitleMatch ? 'subtitle' : authorsMatched.length ? 'authorFL' : seriesMatch ? 'series' : false // ISBN match has to be exact to prevent isbn matches to flood results. Remove dashes since isbn might have those
var isbnMatch = this._isbn.toLowerCase().replace(/-/g, '') === search.replace(/-/g, '')
var asinMatch = this._asin.toLowerCase() === search
var bookMatchKey = titleMatch ? 'title' : subtitleMatch ? 'subtitle' : authorsMatched.length ? 'authorFL' : seriesMatch ? 'series' : isbnMatch ? 'isbn' : asinMatch ? 'asin' : false
var bookMatchText = bookMatchKey ? this[bookMatchKey] : '' var bookMatchText = bookMatchKey ? this[bookMatchKey] : ''
return { return {
book: bookMatchKey, book: bookMatchKey,
@ -343,6 +356,18 @@ class Book {
{ {
tag: 'tagSeriesPart', tag: 'tagSeriesPart',
key: 'volumeNumber' key: 'volumeNumber'
},
{
tag: 'tagIsbn',
key: 'isbn'
},
{
tag: 'tagLanguage',
key: 'language'
},
{
tag: 'tagASIN',
key: 'asin'
} }
] ]

View File

@ -1,4 +1,4 @@
const { CoverDestination, BookCoverAspectRatio } = require('../utils/constants') const { CoverDestination, BookCoverAspectRatio, BookshelfView } = require('../utils/constants')
const Logger = require('../Logger') const Logger = require('../Logger')
class ServerSettings { class ServerSettings {
@ -12,6 +12,7 @@ class ServerSettings {
// Scanner // Scanner
this.scannerParseSubtitle = false this.scannerParseSubtitle = false
this.scannerFindCovers = false this.scannerFindCovers = false
this.scannerCoverProvider = 'google'
this.scannerPreferAudioMetadata = false this.scannerPreferAudioMetadata = false
this.scannerPreferOpfMetadata = false this.scannerPreferOpfMetadata = false
@ -34,7 +35,8 @@ class ServerSettings {
this.loggerScannerLogsToKeep = 2 this.loggerScannerLogsToKeep = 2
// Cover // Cover
this.coverAspectRatio = BookCoverAspectRatio.STANDARD this.coverAspectRatio = BookCoverAspectRatio.SQUARE
this.bookshelfView = BookshelfView.STANDARD
this.logLevel = Logger.logLevel this.logLevel = Logger.logLevel
this.version = null this.version = null
@ -48,6 +50,7 @@ class ServerSettings {
this.autoTagNew = settings.autoTagNew this.autoTagNew = settings.autoTagNew
this.newTagExpireDays = settings.newTagExpireDays this.newTagExpireDays = settings.newTagExpireDays
this.scannerFindCovers = !!settings.scannerFindCovers this.scannerFindCovers = !!settings.scannerFindCovers
this.scannerCoverProvider = settings.scannerCoverProvider || 'google'
this.scannerParseSubtitle = settings.scannerParseSubtitle this.scannerParseSubtitle = settings.scannerParseSubtitle
this.scannerPreferAudioMetadata = !!settings.scannerPreferAudioMetadata this.scannerPreferAudioMetadata = !!settings.scannerPreferAudioMetadata
this.scannerPreferOpfMetadata = !!settings.scannerPreferOpfMetadata this.scannerPreferOpfMetadata = !!settings.scannerPreferOpfMetadata
@ -64,7 +67,8 @@ class ServerSettings {
this.loggerDailyLogsToKeep = settings.loggerDailyLogsToKeep || 7 this.loggerDailyLogsToKeep = settings.loggerDailyLogsToKeep || 7
this.loggerScannerLogsToKeep = settings.loggerScannerLogsToKeep || 2 this.loggerScannerLogsToKeep = settings.loggerScannerLogsToKeep || 2
this.coverAspectRatio = settings.coverAspectRatio || BookCoverAspectRatio.STANDARD this.coverAspectRatio = settings.coverAspectRatio || BookCoverAspectRatio.SQUARE
this.bookshelfView = settings.bookshelfView || BookshelfView.STANDARD
this.logLevel = settings.logLevel || Logger.logLevel this.logLevel = settings.logLevel || Logger.logLevel
this.version = settings.version || null this.version = settings.version || null
@ -80,6 +84,7 @@ class ServerSettings {
autoTagNew: this.autoTagNew, autoTagNew: this.autoTagNew,
newTagExpireDays: this.newTagExpireDays, newTagExpireDays: this.newTagExpireDays,
scannerFindCovers: this.scannerFindCovers, scannerFindCovers: this.scannerFindCovers,
scannerCoverProvider: this.scannerCoverProvider,
scannerParseSubtitle: this.scannerParseSubtitle, scannerParseSubtitle: this.scannerParseSubtitle,
scannerPreferAudioMetadata: this.scannerPreferAudioMetadata, scannerPreferAudioMetadata: this.scannerPreferAudioMetadata,
scannerPreferOpfMetadata: this.scannerPreferOpfMetadata, scannerPreferOpfMetadata: this.scannerPreferOpfMetadata,
@ -93,6 +98,7 @@ class ServerSettings {
loggerDailyLogsToKeep: this.loggerDailyLogsToKeep, loggerDailyLogsToKeep: this.loggerDailyLogsToKeep,
loggerScannerLogsToKeep: this.loggerScannerLogsToKeep, loggerScannerLogsToKeep: this.loggerScannerLogsToKeep,
coverAspectRatio: this.coverAspectRatio, coverAspectRatio: this.coverAspectRatio,
bookshelfView: this.bookshelfView,
logLevel: this.logLevel, logLevel: this.logLevel,
version: this.version version: this.version
} }

View File

@ -140,7 +140,9 @@ class User {
if (user.audiobooks) { if (user.audiobooks) {
this.audiobooks = {} this.audiobooks = {}
for (const key in user.audiobooks) { for (const key in user.audiobooks) {
if (user.audiobooks[key]) { if (key === '[object Object]') { // TEMP: Bug remove bad data
Logger.warn('[User] Construct found invalid UAD')
} else if (user.audiobooks[key]) {
this.audiobooks[key] = new UserAudiobookData(user.audiobooks[key]) this.audiobooks[key] = new UserAudiobookData(user.audiobooks[key])
} }
} }
@ -207,16 +209,16 @@ class User {
return this.audiobooks[stream.audiobookId] return this.audiobooks[stream.audiobookId]
} }
updateAudiobookData(audiobook, updatePayload) { updateAudiobookData(audiobookId, updatePayload) {
if (!this.audiobooks) this.audiobooks = {} if (!this.audiobooks) this.audiobooks = {}
if (!this.audiobooks[audiobook.id]) { if (!this.audiobooks[audiobookId]) {
this.audiobooks[audiobook.id] = new UserAudiobookData() this.audiobooks[audiobookId] = new UserAudiobookData()
this.audiobooks[audiobook.id].audiobookId = audiobook.id this.audiobooks[audiobookId].audiobookId = audiobookId
} }
var wasUpdated = this.audiobooks[audiobook.id].update(updatePayload) var wasUpdated = this.audiobooks[audiobookId].update(updatePayload)
if (wasUpdated) { if (wasUpdated) {
// Logger.debug(`[User] UserAudiobookData was updated ${JSON.stringify(this.audiobooks[audiobook.id])}`) // Logger.debug(`[User] UserAudiobookData was updated ${JSON.stringify(this.audiobooks[audiobookId])}`)
return this.audiobooks[audiobook.id] return this.audiobooks[audiobookId]
} }
return false return false
} }
@ -251,7 +253,7 @@ class User {
if (!this.audiobooks || !this.audiobooks[audiobook.id]) { if (!this.audiobooks || !this.audiobooks[audiobook.id]) {
return false return false
} }
return this.updateAudiobookData(audiobook, { return this.updateAudiobookData(audiobook.id, {
progress: 0, progress: 0,
currentTime: 0, currentTime: 0,
isRead: false, isRead: false,

View File

@ -86,7 +86,7 @@ class UserAudiobookData {
update(payload) { update(payload) {
var hasUpdates = false var hasUpdates = false
for (const key in payload) { for (const key in payload) {
if (payload[key] !== this[key]) { if (this[key] !== undefined && payload[key] !== this[key]) {
if (key === 'isRead') { if (key === 'isRead') {
if (!payload[key]) { // Updating to Not Read - Reset progress and current time if (!payload[key]) { // Updating to Not Read - Reset progress and current time
this.finishedAt = null this.finishedAt = null

View File

@ -10,6 +10,7 @@ class UserListeningSession {
this.audiobookId = null this.audiobookId = null
this.audiobookTitle = null this.audiobookTitle = null
this.audiobookAuthor = null this.audiobookAuthor = null
this.audiobookDuration = 0
this.audiobookGenres = [] this.audiobookGenres = []
this.date = null this.date = null
@ -32,6 +33,7 @@ class UserListeningSession {
audiobookId: this.audiobookId, audiobookId: this.audiobookId,
audiobookTitle: this.audiobookTitle, audiobookTitle: this.audiobookTitle,
audiobookAuthor: this.audiobookAuthor, audiobookAuthor: this.audiobookAuthor,
audiobookDuration: this.audiobookDuration,
audiobookGenres: [...this.audiobookGenres], audiobookGenres: [...this.audiobookGenres],
date: this.date, date: this.date,
dayOfWeek: this.dayOfWeek, dayOfWeek: this.dayOfWeek,
@ -48,6 +50,7 @@ class UserListeningSession {
this.audiobookId = session.audiobookId this.audiobookId = session.audiobookId
this.audiobookTitle = session.audiobookTitle this.audiobookTitle = session.audiobookTitle
this.audiobookAuthor = session.audiobookAuthor this.audiobookAuthor = session.audiobookAuthor
this.audiobookDuration = session.audiobookDuration || 0
this.audiobookGenres = session.audiobookGenres this.audiobookGenres = session.audiobookGenres
this.date = session.date this.date = session.date
@ -64,6 +67,7 @@ class UserListeningSession {
this.audiobookId = audiobook.id this.audiobookId = audiobook.id
this.audiobookTitle = audiobook.title || '' this.audiobookTitle = audiobook.title || ''
this.audiobookAuthor = audiobook.authorFL || '' this.audiobookAuthor = audiobook.authorFL || ''
this.audiobookDuration = audiobook.duration || 0
this.audiobookGenres = [...audiobook.genres] this.audiobookGenres = [...audiobook.genres]
this.timeListening = 0 this.timeListening = 0

View File

@ -39,8 +39,12 @@ class Audible {
} }
asinSearch(asin) { asinSearch(asin) {
var queryString = `response_groups=rating,series,contributors,product_desc,media,product_extended_attrs` + var queryObj = {
`&image_sizes=500,1024,2000`; response_groups: 'rating,series,contributors,product_desc,media,product_extended_attrs',
image_sizes: '500,1024,2000'
};
var queryString = (new URLSearchParams(queryObj)).toString();
asin = encodeURIComponent(asin);
var url = `https://api.audible.com/1.0/catalog/products/${asin}?${queryString}` var url = `https://api.audible.com/1.0/catalog/products/${asin}?${queryString}`
Logger.debug(`[Audible] ASIN url: ${url}`) Logger.debug(`[Audible] ASIN url: ${url}`)
return axios.get(url).then((res) => { return axios.get(url).then((res) => {

View File

@ -8,6 +8,7 @@ class Audnexus {
} }
authorASINsRequest(name) { authorASINsRequest(name) {
name = encodeURIComponent(name);
return axios.get(`${this.baseUrl}/authors?name=${name}`).then((res) => { return axios.get(`${this.baseUrl}/authors?name=${name}`).then((res) => {
return res.data || [] return res.data || []
}).catch((error) => { }).catch((error) => {
@ -17,6 +18,7 @@ class Audnexus {
} }
authorRequest(asin) { authorRequest(asin) {
asin = encodeURIComponent(asin);
return axios.get(`${this.baseUrl}/authors/${asin}`).then((res) => { return axios.get(`${this.baseUrl}/authors/${asin}`).then((res) => {
return res.data return res.data
}).catch((error) => { }).catch((error) => {

View File

@ -32,8 +32,12 @@ class GoogleBooks {
} }
async search(title, author) { async search(title, author) {
title = encodeURIComponent(title)
var queryString = `q=intitle:${title}` var queryString = `q=intitle:${title}`
if (author) queryString += `+inauthor:${author}` if (author) {
author = encodeURIComponent(author)
queryString += `+inauthor:${author}`
}
var url = `https://www.googleapis.com/books/v1/volumes?${queryString}` var url = `https://www.googleapis.com/books/v1/volumes?${queryString}`
Logger.debug(`[GoogleBooks] Search url: ${url}`) Logger.debug(`[GoogleBooks] Search url: ${url}`)
var items = await axios.get(url).then((res) => { var items = await axios.get(url).then((res) => {

View File

@ -15,6 +15,7 @@ class LibGen {
await this.init() await this.init()
} }
queryTitle = queryTitle.replace(/'/g, '') queryTitle = queryTitle.replace(/'/g, '')
queryTitle = encodeURIComponent(queryTitle);
var options = { var options = {
mirror: this.mirror, mirror: this.mirror,
query: queryTitle, query: queryTitle,

View File

@ -85,7 +85,7 @@ class OpenLibrary {
} }
async searchTitle(title) { async searchTitle(title) {
title = title.replace(/'/g, '') title = encodeURIComponent(title);
var lookupData = await this.get(`/search.json?title=${title}`) var lookupData = await this.get(`/search.json?title=${title}`)
if (!lookupData) { if (!lookupData) {
return { return {

View File

@ -9,11 +9,7 @@ const { LogLevel } = require('../utils/constants')
class AudioFileScanner { class AudioFileScanner {
constructor() { } constructor() { }
getTrackNumberFromMeta(scanData) { getTrackAndDiscNumberFromFilename(bookScanData, filename) {
return !isNaN(scanData.trackNumber) && scanData.trackNumber !== null ? Math.trunc(Number(scanData.trackNumber)) : null
}
getTrackNumberFromFilename(bookScanData, filename) {
const { title, author, series, publishYear } = bookScanData const { title, author, series, publishYear } = bookScanData
var partbasename = Path.basename(filename, Path.extname(filename)) var partbasename = Path.basename(filename, Path.extname(filename))
@ -23,39 +19,24 @@ class AudioFileScanner {
if (series) partbasename = partbasename.replace(series, '') if (series) partbasename = partbasename.replace(series, '')
if (publishYear) partbasename = partbasename.replace(publishYear) if (publishYear) partbasename = partbasename.replace(publishYear)
// Remove eg. "disc 1" from path // Look for disc number
partbasename = partbasename.replace(/\bdisc \d\d?\b/i, '') var discNumber = null
var discMatch = partbasename.match(/\b(disc|cd) ?(\d\d?)\b/i)
// Remove "cd01" or "cd 01" from path if (discMatch && discMatch.length > 2 && discMatch[2]) {
partbasename = partbasename.replace(/\bcd ?\d\d?\b/i, '') if (!isNaN(discMatch[2])) {
discNumber = Number(discMatch[2])
var numbersinpath = partbasename.match(/\d{1,4}/g)
if (!numbersinpath) return null
var number = numbersinpath.length ? parseInt(numbersinpath[0]) : null
return number
}
getCdNumberFromFilename(bookScanData, filename) {
const { title, author, series, publishYear } = bookScanData
var partbasename = Path.basename(filename, Path.extname(filename))
// Remove title, author, series, and publishYear from filename if there
if (title) partbasename = partbasename.replace(title, '')
if (author) partbasename = partbasename.replace(author, '')
if (series) partbasename = partbasename.replace(series, '')
if (publishYear) partbasename = partbasename.replace(publishYear)
var cdNumber = null
var cdmatch = partbasename.match(/\b(disc|cd) ?(\d\d?)\b/i)
if (cdmatch && cdmatch.length > 2 && cdmatch[2]) {
if (!isNaN(cdmatch[2])) {
cdNumber = Number(cdmatch[2])
} }
// Remove disc number from filename
partbasename = partbasename.replace(/\b(disc|cd) ?(\d\d?)\b/i, '')
} }
return cdNumber var numbersinpath = partbasename.match(/\d{1,4}/g)
var trackNumber = numbersinpath && numbersinpath.length ? parseInt(numbersinpath[0]) : null
return {
trackNumber,
discNumber
}
} }
getAverageScanDurationMs(results) { getAverageScanDurationMs(results) {
@ -76,20 +57,21 @@ class AudioFileScanner {
// Logger.debug(`[AudioFileScanner] Finished Probe ${audioFileData.fullPath} elapsed ${msToTimestamp(Date.now() - probeStart, true)}`) // Logger.debug(`[AudioFileScanner] Finished Probe ${audioFileData.fullPath} elapsed ${msToTimestamp(Date.now() - probeStart, true)}`)
var audioFile = new AudioFile() var audioFile = new AudioFile()
audioFileData.trackNumFromMeta = this.getTrackNumberFromMeta(probeData) audioFileData.trackNumFromMeta = probeData.trackNumber
audioFileData.trackNumFromFilename = this.getTrackNumberFromFilename(bookScanData, audioFileData.filename) audioFileData.discNumFromMeta = probeData.discNumber
audioFileData.cdNumFromFilename = this.getCdNumberFromFilename(bookScanData, audioFileData.filename)
audioFile.setDataFromProbe(audioFileData, probeData) const { trackNumber, discNumber } = this.getTrackAndDiscNumberFromFilename(bookScanData, audioFileData.filename)
if (audioFile.embeddedCoverArt) { audioFileData.trackNumFromFilename = trackNumber
audioFileData.discNumFromFilename = discNumber
audioFile.setDataFromProbe(audioFileData, probeData)
}
return { return {
audioFile, audioFile,
elapsed: Date.now() - probeStart elapsed: Date.now() - probeStart
} }
} }
// Returns array of { AudioFile, elapsed, averageScanDuration } from audio file scan objects // Returns array of { AudioFile, elapsed, averageScanDuration } from audio file scan objects
async executeAudioFileScans(audioFileDataArray, bookScanData) { async executeAudioFileScans(audioFileDataArray, bookScanData) {
var proms = [] var proms = []
@ -105,6 +87,86 @@ class AudioFileScanner {
} }
} }
isSequential(nums) {
if (!nums || !nums.length) return false
if (nums.length === 1) return true
var prev = nums[0]
for (let i = 1; i < nums.length; i++) {
if (nums[i] - prev > 1) return false
prev = nums[i]
}
return true
}
removeDupes(nums) {
if (!nums || !nums.length) return []
if (nums.length === 1) return nums
var nodupes = [nums[0]]
nums.forEach((num) => {
if (num > nodupes[nodupes.length - 1]) nodupes.push(num)
})
return nodupes
}
runSmartTrackOrder(audiobook, audioFiles) {
var discsFromFilename = []
var tracksFromFilename = []
var discsFromMeta = []
var tracksFromMeta = []
audioFiles.forEach((af) => {
if (af.discNumFromFilename !== null) discsFromFilename.push(af.discNumFromFilename)
if (af.discNumFromMeta !== null) discsFromMeta.push(af.discNumFromMeta)
if (af.trackNumFromFilename !== null) tracksFromFilename.push(af.trackNumFromFilename)
if (af.trackNumFromMeta !== null) tracksFromMeta.push(af.trackNumFromMeta)
af.validateTrackIndex() // Sets error if no valid track number
})
discsFromFilename.sort((a, b) => a - b)
discsFromMeta.sort((a, b) => a - b)
tracksFromFilename.sort((a, b) => a - b)
tracksFromMeta.sort((a, b) => a - b)
var discKey = null
if (discsFromMeta.length === audioFiles.length && this.isSequential(discsFromMeta)) {
discKey = 'discNumFromMeta'
} else if (discsFromFilename.length === audioFiles.length && this.isSequential(discsFromFilename)) {
discKey = 'discNumFromFilename'
}
var trackKey = null
tracksFromFilename = this.removeDupes(tracksFromFilename)
tracksFromMeta = this.removeDupes(tracksFromMeta)
if (tracksFromFilename.length > tracksFromMeta.length) {
trackKey = 'trackNumFromFilename'
} else {
trackKey = 'trackNumFromMeta'
}
if (discKey !== null) {
Logger.debug(`[AudioFileScanner] Smart track order for "${audiobook.title}" using disc key ${discKey} and track key ${trackKey}`)
audioFiles.sort((a, b) => {
let Dx = a[discKey] - b[discKey]
if (Dx === 0) Dx = a[trackKey] - b[trackKey]
return Dx
})
} else {
Logger.debug(`[AudioFileScanner] Smart track order for "${audiobook.title}" using track key ${trackKey}`)
audioFiles.sort((a, b) => a[trackKey] - b[trackKey])
}
for (let i = 0; i < audioFiles.length; i++) {
audioFiles[i].index = i + 1
var existingAF = audiobook.getAudioFileByIno(audioFiles[i].ino)
if (existingAF) {
audiobook.updateAudioFile(audioFiles[i])
} else {
audiobook.addAudioFile(audioFiles[i])
}
}
}
async scanAudioFiles(audioFileDataArray, bookScanData, audiobook, preferAudioMetadata, libraryScan = null) { async scanAudioFiles(audioFileDataArray, bookScanData, audiobook, preferAudioMetadata, libraryScan = null) {
var hasUpdated = false var hasUpdated = false
@ -114,37 +176,34 @@ class AudioFileScanner {
libraryScan.addLog(LogLevel.DEBUG, `Book "${bookScanData.path}" Audio file scan took ${audioScanResult.elapsed}ms for ${audioScanResult.audioFiles.length} with average time of ${audioScanResult.averageScanDuration}ms`) libraryScan.addLog(LogLevel.DEBUG, `Book "${bookScanData.path}" Audio file scan took ${audioScanResult.elapsed}ms for ${audioScanResult.audioFiles.length} with average time of ${audioScanResult.averageScanDuration}ms`)
} }
var totalAudioFilesToInclude = audiobook.audioFilesToInclude.filter(af => !audioScanResult.audioFiles.find(_af => _af.ino === af.ino)).length + audioScanResult.audioFiles.length var totalAudioFilesToInclude = audioScanResult.audioFiles.length
var newAudioFiles = audioScanResult.audioFiles.filter(af => {
return !audiobook.audioFilesToInclude.find(_af => _af.ino === af.ino)
})
// validate & add/update audio files to audiobook if (newAudioFiles.length) {
for (let i = 0; i < audioScanResult.audioFiles.length; i++) { // Single Track Audiobooks
var newAF = audioScanResult.audioFiles[i] if (totalAudioFilesToInclude === 1) {
var existingAF = audiobook.getAudioFileByIno(newAF.ino) var af = audioScanResult.audioFiles[0]
af.index = 1
var trackIndex = null audiobook.addAudioFile(af)
if (totalAudioFilesToInclude === 1) { // Single track audiobooks hasUpdated = true
trackIndex = 1
} else if (existingAF && existingAF.manuallyVerified) { // manually verified audio files use existing index
trackIndex = existingAF.index
} else { } else {
trackIndex = newAF.validateTrackIndex() this.runSmartTrackOrder(audiobook, audioScanResult.audioFiles)
}
if (trackIndex !== null) {
if (audiobook.checkHasTrackNum(trackIndex, newAF.ino)) {
newAF.setDuplicateTrackNumber(trackIndex)
} else {
newAF.index = trackIndex
}
}
if (existingAF) {
if (audiobook.updateAudioFile(newAF)) {
hasUpdated = true
}
} else {
audiobook.addAudioFile(newAF)
hasUpdated = true hasUpdated = true
} }
} else {
Logger.debug(`[AudioFileScanner] No audio track re-order required`)
// Only update metadata not index
audioScanResult.audioFiles.forEach((af) => {
var existingAF = audiobook.getAudioFileByIno(af.ino)
if (existingAF) {
af.index = existingAF.index
if (audiobook.updateAudioFile(af)) {
hasUpdated = true
}
}
})
} }
// Set book details from audio file ID3 tags, optional prefer // Set book details from audio file ID3 tags, optional prefer

View File

@ -19,6 +19,9 @@ class AudioProbeData {
this.trackNumber = null this.trackNumber = null
this.trackTotal = null this.trackTotal = null
this.discNumber = null
this.discTotal = null
} }
getEmbeddedCoverArt(videoStream) { getEmbeddedCoverArt(videoStream) {
@ -55,10 +58,22 @@ class AudioProbeData {
if (this.audioFileMetadata.tagTrack) { if (this.audioFileMetadata.tagTrack) {
var trackParts = this.audioFileMetadata.tagTrack.split('/').map(part => Number(part)) var trackParts = this.audioFileMetadata.tagTrack.split('/').map(part => Number(part))
if (trackParts.length > 0) { if (trackParts.length > 0) {
this.trackNumber = trackParts[0] // Fractional track numbers not supported
this.trackNumber = !isNaN(trackParts[0]) ? Math.trunc(trackParts[0]) : null
} }
if (trackParts.length > 1) { if (trackParts.length > 1) {
this.trackTotal = trackParts[1] this.trackTotal = !isNaN(trackParts[1]) ? trackParts[1] : null
}
}
// Parse disc tag
if (this.audioFileMetadata.tagDisc) {
var discParts = this.audioFileMetadata.tagDisc.split('/').map(p => Number(p))
if (discParts.length > 0) {
this.discNumber = !isNaN(discParts[0]) ? Math.trunc(discParts[0]) : null
}
if (discParts.length > 1) {
this.discTotal = !isNaN(discParts[1]) ? discParts[1] : null
} }
} }
} }

View File

@ -322,7 +322,7 @@ class Scanner {
} }
async rescanAudiobook(audiobookCheckData, libraryScan) { async rescanAudiobook(audiobookCheckData, libraryScan) {
const { newAudioFileData, newOtherFileData, audiobook, bookScanData, updated, existingAudioFileData, existingOtherFileData } = audiobookCheckData const { newAudioFileData, audioFilesRemoved, newOtherFileData, audiobook, bookScanData, updated, existingAudioFileData, existingOtherFileData } = audiobookCheckData
libraryScan.addLog(LogLevel.DEBUG, `Library "${libraryScan.libraryName}" Re-scanning "${audiobook.path}"`) libraryScan.addLog(LogLevel.DEBUG, `Library "${libraryScan.libraryName}" Re-scanning "${audiobook.path}"`)
var hasUpdated = updated var hasUpdated = updated
@ -342,7 +342,7 @@ class Scanner {
} }
} }
// Scan new audio files // Scan new audio files
if (newAudioFileData.length) { if (newAudioFileData.length || audioFilesRemoved.length) {
if (await AudioFileScanner.scanAudioFiles(newAudioFileData, bookScanData, audiobook, libraryScan.preferAudioMetadata, libraryScan)) { if (await AudioFileScanner.scanAudioFiles(newAudioFileData, bookScanData, audiobook, libraryScan.preferAudioMetadata, libraryScan)) {
hasUpdated = true hasUpdated = true
} }
@ -459,11 +459,38 @@ class Scanner {
async scanFolderUpdates(library, folder, fileUpdateBookGroup) { async scanFolderUpdates(library, folder, fileUpdateBookGroup) {
Logger.debug(`[Scanner] Scanning file update groups in folder "${folder.id}" of library "${library.name}"`) Logger.debug(`[Scanner] Scanning file update groups in folder "${folder.id}" of library "${library.name}"`)
// First pass - Remove files in parent dirs of audiobooks and remap the fileupdate group
// Test Case: Moving audio files from audiobook folder to author folder should trigger a re-scan of audiobook
var updateGroup = { ...fileUpdateBookGroup }
for (const bookDir in updateGroup) {
var bookDirNestedFiles = fileUpdateBookGroup[bookDir].filter(b => b.includes('/'))
if (!bookDirNestedFiles.length) continue;
var firstNest = bookDirNestedFiles[0].split('/').shift()
var altDir = `${bookDir}/${firstNest}`
var fullPath = Path.posix.join(folder.fullPath.replace(/\\/g, '/'), bookDir)
var childAudiobook = this.db.audiobooks.find(ab => ab.fullPath !== fullPath && ab.fullPath.startsWith(fullPath))
if (!childAudiobook) {
continue;
}
var altFullPath = Path.posix.join(folder.fullPath.replace(/\\/g, '/'), altDir)
var altChildAudiobook = this.db.audiobooks.find(ab => ab.fullPath !== altFullPath && ab.fullPath.startsWith(altFullPath))
if (altChildAudiobook) {
continue;
}
delete fileUpdateBookGroup[bookDir]
fileUpdateBookGroup[altDir] = bookDirNestedFiles.map((f) => f.split('/').slice(1).join('/'))
Logger.warn(`[Scanner] Some files were modified in a parent directory of an audiobook "${childAudiobook.title}" - ignoring`)
}
// Second pass: Check for new/updated/removed audiobooks
var bookGroupingResults = {} var bookGroupingResults = {}
for (const bookDir in fileUpdateBookGroup) { for (const bookDir in fileUpdateBookGroup) {
var fullPath = Path.posix.join(folder.fullPath.replace(/\\/g, '/'), bookDir) var fullPath = Path.posix.join(folder.fullPath.replace(/\\/g, '/'), bookDir)
// Check if book dir group is already an audiobook or in a subdir of an audiobook // Check if book dir group is already an audiobook
var existingAudiobook = this.db.audiobooks.find(ab => fullPath.startsWith(ab.fullPath)) var existingAudiobook = this.db.audiobooks.find(ab => fullPath.startsWith(ab.fullPath))
if (existingAudiobook) { if (existingAudiobook) {
@ -519,7 +546,8 @@ class Scanner {
titleDistance: 2, titleDistance: 2,
authorDistance: 2 authorDistance: 2
} }
var results = await this.bookFinder.findCovers('google', audiobook.title, audiobook.authorFL, options) var scannerCoverProvider = this.db.serverSettings.scannerCoverProvider
var results = await this.bookFinder.findCovers(scannerCoverProvider, audiobook.title, audiobook.authorFL, options)
if (results.length) { if (results.length) {
if (libraryScan) libraryScan.addLog(LogLevel.DEBUG, `Found best cover for "${audiobook.title}"`) if (libraryScan) libraryScan.addLog(LogLevel.DEBUG, `Found best cover for "${audiobook.title}"`)
else Logger.debug(`[Scanner] Found best cover for "${audiobook.title}"`) else Logger.debug(`[Scanner] Found best cover for "${audiobook.title}"`)

View File

@ -16,6 +16,11 @@ module.exports.BookCoverAspectRatio = {
SQUARE: 1 SQUARE: 1
} }
module.exports.BookshelfView = {
STANDARD: 0,
TITLES: 1
}
module.exports.LogLevel = { module.exports.LogLevel = {
TRACE: 0, TRACE: 0,
DEBUG: 1, DEBUG: 1,

View File

@ -11,7 +11,7 @@ module.exports = {
getFiltered(audiobooks, filterBy, user) { getFiltered(audiobooks, filterBy, user) {
var filtered = audiobooks var filtered = audiobooks
var searchGroups = ['genres', 'tags', 'series', 'authors', 'progress', 'narrators'] var searchGroups = ['genres', 'tags', 'series', 'authors', 'progress', 'narrators', 'languages']
var group = searchGroups.find(_group => filterBy.startsWith(_group + '.')) var group = searchGroups.find(_group => filterBy.startsWith(_group + '.'))
if (group) { if (group) {
var filterVal = filterBy.replace(`${group}.`, '') var filterVal = filterBy.replace(`${group}.`, '')
@ -33,6 +33,8 @@ module.exports = {
if (filter === 'In Progress' && (userAudiobook && !userAudiobook.isRead && userAudiobook.progress > 0)) return true if (filter === 'In Progress' && (userAudiobook && !userAudiobook.isRead && userAudiobook.progress > 0)) return true
return false return false
}) })
} else if (group === 'languages') {
filtered = filtered.filter(ab => ab.book && ab.book.language === filter)
} }
} else if (filterBy === 'issues') { } else if (filterBy === 'issues') {
filtered = filtered.filter(ab => { filtered = filtered.filter(ab => {
@ -49,7 +51,8 @@ module.exports = {
genres: [], genres: [],
tags: [], tags: [],
series: [], series: [],
narrators: [] narrators: [],
languages: []
} }
audiobooks.forEach((ab) => { audiobooks.forEach((ab) => {
if (ab.book._authorsList.length) { if (ab.book._authorsList.length) {
@ -73,7 +76,14 @@ module.exports = {
if (narrator && !data.narrators.includes(narrator)) data.narrators.push(narrator) if (narrator && !data.narrators.includes(narrator)) data.narrators.push(narrator)
}) })
} }
if (ab.book._language && !data.languages.includes(ab.book._language)) data.languages.push(ab.book._language)
}) })
data.authors = naturalSort(data.authors).asc()
data.genres = naturalSort(data.genres).asc()
data.tags = naturalSort(data.tags).asc()
data.series = naturalSort(data.series).asc()
data.narrators = naturalSort(data.narrators).asc()
data.languages = naturalSort(data.languages).asc()
return data return data
}, },
@ -113,7 +123,7 @@ module.exports = {
userAudiobook: user.getAudiobookJSON(book.id), userAudiobook: user.getAudiobookJSON(book.id),
book book
} }
}) }).filter(b => !!b.userAudiobook)
}, },
getBooksMostRecentlyRead(booksWithUserAb, limit, minified = false) { getBooksMostRecentlyRead(booksWithUserAb, limit, minified = false) {
@ -177,12 +187,20 @@ module.exports = {
return Object.values(authorsMap).sort((a, b) => b.count - a.count) return Object.values(authorsMap).sort((a, b) => b.count - a.count)
}, },
getAudiobooksTotalDuration(audiobooks) { getAudiobookDurationStats(audiobooks) {
var sorted = sort(audiobooks).desc(a => a.duration)
var top10 = sorted.slice(0, 10).map(ab => ({ title: ab.book.title, duration: ab.duration })).filter(ab => ab.duration > 0)
var totalDuration = 0 var totalDuration = 0
var numAudioTracks = 0
audiobooks.forEach((ab) => { audiobooks.forEach((ab) => {
totalDuration += ab.duration totalDuration += ab.duration
numAudioTracks += ab.tracks.length
}) })
return totalDuration return {
totalDuration,
numAudioTracks,
longstAudiobooks: top10
}
}, },
getAudiobooksTotalSize(audiobooks) { getAudiobooksTotalSize(audiobooks) {

View File

@ -1,4 +1,4 @@
var Ffmpeg = require('fluent-ffmpeg') const ffprobe = require('node-ffprobe')
const Path = require('path') const Path = require('path')
const AudioProbeData = require('../scanner/AudioProbeData') const AudioProbeData = require('../scanner/AudioProbeData')
@ -125,15 +125,37 @@ function parseMediaStreamInfo(stream, all_streams, total_bit_rate) {
return info return info
} }
function isNullOrNaN(val) {
return val === null || isNaN(val)
}
/* Example chapter object
* {
"id": 71,
"time_base": "1/1000",
"start": 80792671,
"start_time": "80792.671000",
"end": 81084755,
"end_time": "81084.755000",
"tags": {
"title": "072"
}
* }
*/
function parseChapters(chapters) { function parseChapters(chapters) {
if (!chapters) return [] if (!chapters) return []
return chapters.map(chap => { return chapters.map(chap => {
var title = chap['TAG:title'] || chap.title || '' var title = chap['TAG:title'] || chap.title || ''
if (!title && chap.tags && chap.tags.title) title = chap.tags.title
var timebase = chap.time_base && chap.time_base.includes('/') ? Number(chap.time_base.split('/')[1]) : 1 var timebase = chap.time_base && chap.time_base.includes('/') ? Number(chap.time_base.split('/')[1]) : 1
var start = !isNullOrNaN(chap.start_time) ? Number(chap.start_time) : !isNullOrNaN(chap.start) ? Number(chap.start) / timebase : 0
var end = !isNullOrNaN(chap.end_time) ? Number(chap.end_time) : !isNullOrNaN(chap.end) ? Number(chap.end) / timebase : 0
return { return {
id: chap.id, id: chap.id,
start: !isNaN(chap.start_time) ? chap.start_time : (chap.start / timebase), start,
end: chap.end_time || (chap.end / timebase), end,
title title
} }
}) })
@ -152,6 +174,7 @@ function parseTags(format, verbose) {
file_tag_title: tryGrabTags(format, 'title', 'tit2', 'tt2'), file_tag_title: tryGrabTags(format, 'title', 'tit2', 'tt2'),
file_tag_subtitle: tryGrabTags(format, 'subtitle', 'tit3', 'tt3'), file_tag_subtitle: tryGrabTags(format, 'subtitle', 'tit3', 'tt3'),
file_tag_track: tryGrabTags(format, 'track', 'trck', 'trk'), file_tag_track: tryGrabTags(format, 'track', 'trck', 'trk'),
file_tag_disc: tryGrabTags(format, 'discnumber', 'disc', 'disk', 'tpos'),
file_tag_album: tryGrabTags(format, 'album', 'talb', 'tal'), file_tag_album: tryGrabTags(format, 'album', 'talb', 'tal'),
file_tag_artist: tryGrabTags(format, 'artist', 'tpe1', 'tp1'), file_tag_artist: tryGrabTags(format, 'artist', 'tpe1', 'tp1'),
file_tag_albumartist: tryGrabTags(format, 'albumartist', 'album_artist', 'tpe2'), file_tag_albumartist: tryGrabTags(format, 'albumartist', 'album_artist', 'tpe2'),
@ -163,6 +186,9 @@ function parseTags(format, verbose) {
file_tag_genre: tryGrabTags(format, 'genre', 'tcon', 'tco'), file_tag_genre: tryGrabTags(format, 'genre', 'tcon', 'tco'),
file_tag_series: tryGrabTag(format, 'series'), file_tag_series: tryGrabTag(format, 'series'),
file_tag_seriespart: tryGrabTag(format, 'series-part'), file_tag_seriespart: tryGrabTag(format, 'series-part'),
file_tag_isbn: tryGrabTag(format, 'isbn'),
file_tag_language: tryGrabTags(format, 'language', 'lang'),
file_tag_asin: tryGrabTag(format, 'asin'),
// Not sure if these are actually used yet or not // Not sure if these are actually used yet or not
file_tag_creation_time: tryGrabTag(format, 'creation_time'), file_tag_creation_time: tryGrabTag(format, 'creation_time'),
@ -180,7 +206,7 @@ function parseTags(format, verbose) {
} }
} }
var keysToLookOutFor = ['file_tag_genre1', 'file_tag_genre2', 'file_tag_series', 'file_tag_seriespart', 'file_tag_movement', 'file_tag_movementname', 'file_tag_wwwaudiofile', 'file_tag_contentgroup', 'file_tag_releasetime'] var keysToLookOutFor = ['file_tag_genre1', 'file_tag_genre2', 'file_tag_series', 'file_tag_seriespart', 'file_tag_movement', 'file_tag_movementname', 'file_tag_wwwaudiofile', 'file_tag_contentgroup', 'file_tag_releasetime', 'file_tag_isbn']
keysToLookOutFor.forEach((key) => { keysToLookOutFor.forEach((key) => {
if (tags[key]) { if (tags[key]) {
Logger.debug(`Notable! ${key} => ${tags[key]}`) Logger.debug(`Notable! ${key} => ${tags[key]}`)
@ -252,27 +278,27 @@ function parseProbeData(data, verbose = false) {
// Updated probe returns AudioProbeData object // Updated probe returns AudioProbeData object
function probe(filepath, verbose = false) { function probe(filepath, verbose = false) {
return new Promise((resolve) => { var options = {}
Ffmpeg.ffprobe(filepath, ['-show_chapters'], (err, raw) => { if (process.env.FFPROBE_PATH) {
if (err) { options.path = process.env.FFPROBE_PATH
console.error(err) }
var errorMsg = err ? err.message : null return ffprobe(filepath, options)
resolve({ .then(raw => {
error: errorMsg || 'Probe Error' var rawProbeData = parseProbeData(raw, verbose)
}) if (!rawProbeData || !rawProbeData.audio_stream) {
} else { return {
var rawProbeData = parseProbeData(raw, verbose) error: rawProbeData ? 'Invalid audio file: no audio streams found' : 'Probe Failed'
if (!rawProbeData || !rawProbeData.audio_stream) {
resolve({
error: rawProbeData ? 'Invalid audio file: no audio streams found' : 'Probe Failed'
})
} else {
var probeData = new AudioProbeData()
probeData.setData(rawProbeData)
resolve(probeData)
} }
} else {
var probeData = new AudioProbeData()
probeData.setData(rawProbeData)
return probeData
}
})
.catch((err) => {
return {
error: err
} }
}) })
})
} }
module.exports.probe = probe module.exports.probe = probe